Ng build -prod build error after running npm install in a new folder

Here is the error occurring in the prod assembly

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/var/www/project/src'
 @ ./src/main.ts 4:0-74
 @ multi ./src/main.ts

Getting an error because new versions of packages are installed after running npm install. It is not possible to split version versions of packages because the list is too long. He works with aot false, but does not want to build with aot false. Failed to figure out which package is responsible for this.

+4
source share
2 answers

Try

npm i enhanced-resolve@3.3.0

or add it to shrinkwrap.jsonor package-lock.jsonor yarn.lock or update angular-cli as Filipe Silva said

We have released 1.2.4 / 1.3.0-rc.1 to fix this problem.

enhanced-resolve: angular -cli --environment

+3
  • npm
  • node_modules
  • "-": "3.3.0" package.json
  • npm install
  • !

https://github.com/angular/angular-cli/issues/7113

+2

Source: https://habr.com/ru/post/1682132/


All Articles