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.

Build the SPA app with NPM error npm run build:prod

See original GitHub issue

Hi,

I’m following every line of the wiki for the second time and get exact same error when running “npm run build:prod” from the commandline to build the SPA.

The error itself is… ERROR in ./Client/main.ts Module not found: Error: Can’t resolve ‘./$$_gendir/modules/app.module.ngfactory’ in ‘C:\Devlop\Repos\eShopOnContainers\src\Web\WebSPA\Client’ @ ./Client/main.ts 4:0-78 @ multi ./Client/main.ts

npm ERR! Windows_NT 10.0.15063 npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “run” “build:prod” npm ERR! node v6.11.1 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! eshopaspnetnetcoredockerspa@0.0.0 build:prod: ng build --prod --aot --extract-css npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the eshopaspnetnetcoredockerspa@0.0.0 build:prod script ‘ng build --prod --aot --extract-css’. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the eshopaspnetnetcoredockerspa package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ng build --prod --aot --extract-css npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs eshopaspnetnetcoredockerspa npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls eshopaspnetnetcoredockerspa npm ERR! There is likely additional logging output above.

Just like the wiki says, I installed 6.11 Node and npm 3.10.10 as you also can see in the above error information.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
ASADevelopercommented, Jul 31, 2017

I’m not very good at Angular but it seems to be an issue on that address. Just a few minutes after I posted this issue I found a lot of posts about it in the angular repository. I followed one of the suggestions and it works for me now. In this section: https://github.com/dotnet-architecture/eShopOnContainers/wiki/06.-Setting-the-Web-SPA-application-up#build-the-spa-app-with-npm

Instead of just ‘npm install’, I ran ‘npm install enhanced-resolve@3.3.0’.

After that everything worked fine.

@CESARDELATORRE : Perhaps an expert on Angular should look at this or wiki should be updated with this issue/command.

A couple of related source on angular: https://github.com/angular/angular-cli/issues/4551 https://github.com/angular/angular-cli/issues/7125 suggested workaround that worked for me: https://github.com/angular/angular-cli/issues/7113#issuecomment-317387249

I leave this open for other who might have the same issue.

Feel free to close it when you like.

0reactions
ASADevelopercommented, Aug 7, 2017

@CESARDELATORRE Perhaps the reason that it works for you is because you used the ‘dev’ branche instead of the ‘master’ as advised in the Wiki.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The command "npm run build -- --prod" exited with code 1 ...
When I'm going to publish my project then the error 'The command "npm run build -- --prod" exited with code 1' show in...
Read more >
Deployment
Sometimes npm run build works locally but fails during deploy via Heroku. Following are the most common cases. "Module not found: Error: Cannot ......
Read more >
Solved: [ERROR] Failed to execute goal com.github.eirslett...
Solved: Hello, I am trying to create a AEM Maven archetype project named aem-magazine. When I run the build using IntelliJ it shows...
Read more >
npm-run-script
Description. This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts.
Read more >
Deployment
On Netlify, setup up a new project from GitHub with the following settings: Build Command: npm run build or yarn build; Publish directory:...
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