Angular-cli: ng build 鈥攁ot Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'

Created on 27 Sep 2017  路  5Comments  路  Source: angular/angular-cli

OS?

macOS Sierra x64

Versions.

@angular/cli: 1.1.3
node: 6.10.0
os: darwin x64
@angular/animations: 4.4.3
@angular/common: 4.4.3
@angular/compiler: 4.4.3
@angular/core: 4.4.3
@angular/forms: 4.4.3
@angular/http: 4.4.3
@angular/platform-browser: 4.4.3
@angular/platform-browser-dynamic: 4.4.3
@angular/router: 4.4.3
@angular/cli: 1.1.3
@angular/compiler-cli: 4.4.3
@angular/language-service: 4.4.3

Repro steps.

App started using angular cli

The log given by the failure.

This is from my command line:
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/ok13067/projects/test-aot/src'
@ ./src/main.ts 3:0-74
@ multi ./src/main.ts

Desired functionality.

build --aot

repro steps

Most helpful comment

Thanks, @filipesilva & @abelkbil it works like a magic now!!

All 5 comments

Heya, can you provide a repro we can follow to see this error? You're also using a very old version of the CLI, I suggest you upgrade.

Updating to @angular-cli: 1.2.4 fixed the issue for me.
Change your package.json to zone.js: 0.8.14. Delete node_modules folder and run npm install again.

Thanks, @filipesilva & @abelkbil it works like a magic now!!

update npm install [email protected]
for me it's working fine

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings