I'm submitting a ...
[x ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
After npm install I get this warnings
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of @angular/core@^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser@^2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^2.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/forms@^2.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^2.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^2.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/compiler@^2.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^2.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/forms@^2.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
nmp start works without any problems.
If I try to compile a prod release with npm run start:prod I get this errors:
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\login\login.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\register\register.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\dashboard\dashboard.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\editors\editors.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\components\components.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\charts\charts.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\ui\ui.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\forms\forms.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\tables\tables.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir\app\pages\maps\maps.module.ngfactory.ts' in 'C:\Users\dgars\IdeaProjects\ng2-admin\src\$$_gendir'
@ ./src/$$_gendir async
@ ./~/@angular/core/@angular/core.es5.js
@ ./src/main.ts
@ multi ./src/main.ts
Do you have any idea how to solve the problem?
@den1982 I also encountered this. Updating angular-cli to latest version solved the issue for me.
@ManpreetSingh80 can you send me a copy of dist? i get the same error and update the angular-cli the error shows too. my email: [email protected] thank you very much.
Got the same error as well.
I tried what @ManpreetSingh80 suggested (updating angular-cli to latest version), but didn't work still.
I tried several times to update the CLI and recompile and that solved the issue for me.
updating @angular/cli to version 1.2.8 fixed this error for me
@dannyrz Try clearing the node cache and removing node-modules folder and make a fresh npm install
I was with same problem when I found this answer in Angular-Cli issues: AOT build fails #7113
Basically I run npm i [email protected] and ng build --prod works!
Is it enough to make a PR that upgrades cli in package.json to close this?
I hope so
I've solved it after running following instructions!
npm install npm -g
npm install --save-dev @angular/cli@latest
npm install
npm start
Most helpful comment
I've solved it after running following instructions!
npm install npm -gnpm install --save-dev @angular/cli@latestnpm installnpm start