Skip to content

ng build --prod give Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\projectpath\src' #5596

Closed
@asadsahi

Description

@asadsahi
- [x ] bug report 

Versions.

@angular/*": "4.0.0-rc.6

@angular/cli: 1.0.0-rc.4
node: 6.9.1
os: win32 x64
Windows 7 And Window 10

Repro steps.

Just run ng build --prod

The log given by the failure.

dules/@ng-bootstrap/ng-bootstrap/util/util.d.ts
Hash: b8b958c29762fa762c34
Time: 11764ms
chunk    {0} polyfills.62c31de27797344f09a6.bundle.js (polyfills) 158 kB {5} [initial] [rendered]
chunk    {1} main.0080928b6a891ad4f45d.bundle.js (main) 3.21 kB {4} [initial] [rendered]
chunk    {2} styles.4001f4f573259b290c26.bundle.css (styles) 175 bytes {5} [initial] [rendered]
chunk    {3} sw-register.b73048fe3d9f8a1e7ae5.bundle.js (sw-register) 232 bytes {5} [initial] [rendered]
chunk    {4} vendor.87c63162470e632861f4.bundle.js (vendor) 960 kB [initial] [rendered]
chunk    {5} inline.ce192cec606fd32293a6.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in m.replace is not a function

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\Users\asahi\ngnode-fullstack\src'
 @ ./src/main.ts 5:0-74
 @ multi ./src/main.ts

npm ERR! Windows_NT 6.1.7601
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.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! ngnode-fullstack@0.0.1 build:prod: `ng build --prod`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngnode-fullstack@0.0.1 build:prod script 'ng build --prod'.
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 ngnode-fullstack package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng build --prod
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ngnode-fullstack
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ngnode-fullstack
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\asahi\ngnode-fullstack\npm-debug.log

Desired functionality.

Should produce production build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions