Skip to content

ng build --prod failure #7354

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

Closed
shawnwang5 opened this issue Aug 11, 2017 · 10 comments
Closed

ng build --prod failure #7354

shawnwang5 opened this issue Aug 11, 2017 · 10 comments

Comments

@shawnwang5
Copy link

shawnwang5 commented Aug 11, 2017

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.3.0
node: 8.2.1
os: win32 x64
@angular/animations: 4.3.3
@angular/common: 4.3.3
@angular/compiler: 4.3.3
@angular/core: 4.3.3
@angular/forms: 4.3.3
@angular/http: 4.3.3
@angular/platform-browser: 4.3.3
@angular/platform-browser-dynamic: 4.3.3
@angular/router: 4.3.3
@angular/cli: 1.3.0
@angular/compiler-cli: 4.3.3
@angular/language-service: 4.3.3

Repro steps.

  1. ng build --prod
  2. I will see the error message

The log given by the failure.

fs.js:652
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);

  Error: ENOENT: no such file or directory, open 'C:\software\test\node_modules\_@angular_core@4.3.3@@angular\package.json'
    at Object.fs.openSync (fs.js:652:18)
    at Object.fs.readFileSync (fs.js:553:33)
    at licensePlugin.readPackageJson (C:\software\test\node_modules\_license-webpack-plugin@0.5.1@license-webpack-plugin\index.js:26:19)
    at licensePlugin.getModuleInfo (C:\software\test\node_modules\_license-webpack-plugin@0.5.1@license-webpack-plugin\index.js:30:28)
    at licensePlugin.<anonymous> (C:\software\test\node_modules\_license-webpack-plugin@0.5.1@license-webpack-plugin\index.js:81:31)
    at Array.filter (native)
    at licensePlugin.writeModuleInfo (C:\software\test\node_modules\_license-webpack-plugin@0.5.1@license-webpack-plugin\index.js:77:8)
    at licensePlugin.gatherModuleInfo (C:\software\test\node_modules\_license-webpack-plugin@0.5.1@license-webpack-plugin\index.js:117:10)
    at licensePlugin.<anonymous> (C:\software\test\node_modules\_license-webpack-plugin@0.5.1@license-webpack-plugin\index.js:233:12)
    at Compiler.applyPlugins (C:\software\test\node_modules\_tapable@0.2.8@tapable\lib\Tapable.js:61:14)
    at onCompiled (C:\software\test\node_modules\_webpack@3.4.1@webpack\lib\Compiler.js:240:10)
    at applyPluginsAsync.err (C:\software\test\node_modules\_webpack@3.4.1@webpack\lib\Compiler.js:520:14)
    at next (C:\software\test\node_modules\_tapable@0.2.8@tapable\lib\Tapable.js:202:11)
    at Compiler.<anonymous> (C:\software\test\node_modules\_webpack@3.4.1@webpack\lib\CachePlugin.js:62:5)
    at Compiler.applyPluginsAsyncSeries (C:\software\test\node_modules\_tapable@0.2.8@tapable\lib\Tapable.js:206:13)
    at compilation.seal.err (C:\software\test\node_modules\_webpack@3.4.1@webpack\lib\Compiler.js:517:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

Desired functionality.

For the app to compile

Mention any other details that might be useful.

After I installed the following packages, there was a problem.
"@angular-redux/store": "^6.5.7",
"ng2-validation": "^4.2.0",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",

@hieuxlu
Copy link

hieuxlu commented Aug 11, 2017

The directory seems strange. It should be node_modules/@angular instead of node_modules_. This should be unrelated to @angular/cli.

@shawnwang5
Copy link
Author

@hieuxlu It was escaped. I have updated the error message.

@waterscar
Copy link

waterscar commented Aug 15, 2017

I got same issue, both on Ubuntu and Mac

return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/path/node_modules/_@angular_core@4.3.4@@angular/package.json'
    at Object.fs.openSync (fs.js:583:18)
    at Object.fs.readFileSync (fs.js:490:33)

Build without --prod works fine

UPDATE
Mine issue seems to related to cnpm, after deleting node_modules/ folder and use npm install instead, build with --prod works fine again.

@iygnay
Copy link

iygnay commented Aug 15, 2017

same issue

ng build --prod --no-extract-license works fine #7203

@shawnwang5
Copy link
Author

@iygnay Thank you.

@eminoda
Copy link

eminoda commented Sep 7, 2017

why angular-cli doesn‘’t support cnpm?

@Herwt-liyj
Copy link

Mine issue seems to related to cnpm, after deleting node_modules/ folder and use npm install instead, build with --prod works fine again. @waterscar thank you

@FreezeSoul
Copy link

problem with cnpm also.

@jlapton
Copy link

jlapton commented Oct 22, 2018

according to the stacktrace it seems related with "license-webpack-plugin",
since there's no package.json file in dir 'node_modules_@angular_core@4.3.3@@angular' (which holds serveral sub-dirs).
@iygnay thx for the --no-extract-license parameter, and it should be getting rid of the "license-webpack-plugin".

@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 Sep 8, 2019
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

8 participants