Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng build is broken: Could not resolve fs, net, os, crypto. But ng serve works (latest angular-cli). #27863

Closed
1 task
vadimcoder opened this issue Jun 17, 2024 · 2 comments

Comments

@vadimcoder
Copy link

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

I am a first time Angular user

Description

The package "path" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

Screenshot 2024-06-17 at 6 00 22 AM

Minimal Reproduction

ng new myApp
cd myApp
npm install --save paper
import paper from 'paper';
console.log(paper);
npm start      // works OK - see the output in the console
npm run build // fails

Exception or Error

No response

Your Environment

Angular CLI: 18.0.4
Node: 18.20.0
Package Manager: npm 10.5.0
OS: darwin arm64

Angular: 18.0.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1800.4
@angular-devkit/build-angular   18.0.4
@angular-devkit/core            18.0.4
@angular-devkit/schematics      18.0.4
@angular/cli                    18.0.4
@schematics/angular             18.0.4
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.7

Anything else relevant?

No response

@alan-agius4
Copy link
Collaborator

Duplicate of #27425

@alan-agius4 alan-agius4 marked this as a duplicate of #27425 Jun 17, 2024
@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants