question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng build --prod failure

See original GitHub issue

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",

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

24reactions
iygnaycommented, Aug 15, 2017

same issue

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

4reactions
waterscarcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng build --prod is not working properly? how to check this?
If i run that using ng serve command, it works fine. Instead of using ng serve , i used ng build --prod ....
Read more >
ng build --prod failed | Angular - EJ 2 Forums - Syncfusion
We have checked with your query and suspect that the reported issue (“ng build --prod produces build error”) may be caused due to...
Read more >
Angular `ng build --prod` Error - Medium
You built a library, and tried to use it in a project. When building with --prod you see this unhelpful error: 'Unexpected value...
Read more >
Toolips ng build –prod error - MDBootstrap
when I was trying to build production of my project we got this error: in Error: TypeError: Cannot read property 'kind' of undefined...
Read more >
Error in ng build --prod that doesn't happen with ng serve --prod
When I serve the files outputted by with a server (apache, nginx) ng build --prod the app fails to load with js error....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found