Build the SPA app with NPM error npm run build:prod
See original GitHub issueHi,
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:
- Created 6 years ago
- Comments:7
Top GitHub Comments
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.
@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.