Shashikant Pandit
Shashikant Pandit

Reputation: 2854

ng build --prod does not build the code

i executed the command:-

ng bild --prod

here i am using

node version:- v6.11.0

@angular/cli: 1.0.0-rc.2

typescript : Version 2.4.2

throws errors listed below:-

ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'D:\Shashikant D Drive\Ishir Projects\EZForms\ ezforms-server\public\src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts

ERROR in ./src/$$_gendir async Module not found: Error: Can't resolve 'D:\Shashikant D Drive\Ishir Projects\EZForms\ezforms-server\public\src\$$_gendir\app+c ompleted\completed.module.ngfactory.ts' in 'D:\Shashikant D Drive\Ishir Projects\EZForms\ezforms-server\public\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 'D:\Shashikant D Drive\Ishir Projects\EZForms\ezforms-server\public\src\$$_gendir\app+d ashboard\dashboard.module.ngfactory.ts' in 'D:\Shashikant D Drive\Ishir Projects\EZForms\ezforms-server\public\src\$$_gendir' @ ./src/$$_gendir async @ ./~/@angular/core/@angular/core.es5.js @ ./src/main.ts @ multi ./src/main.ts

Here is the attached image which contains application files structure.

enter image description here

Upvotes: 1

Views: 2294

Answers (2)

Sathish Kotha
Sathish Kotha

Reputation: 1111

You can check the errors in your project with ng build --prod --verbose

Upvotes: 1

eko
eko

Reputation: 40677

The issue is related with a bug in angular-cli version.

Try installing npm install [email protected]

or upgrade your angular-cli and Angular to the latest version (1.0.0-rc.2 is really old, latest is 1.2.6).

I suggest the latter; you can follow the documentation to upgrade your cli: https://github.com/angular/angular-cli#updating-angular-cli

Source to the issue: https://github.com/angular/angular-cli/issues/4551#issuecomment-317459157

Upvotes: 4

Related Questions