Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in universal:AOT build: Cannot find module './ngfactory/app/server.app.module.ngfactory'. #317

Closed
usachev-dev opened this issue Jan 25, 2018 · 3 comments

Comments

@usachev-dev
Copy link

All build scripts are working fine, except universal:aot. The same with Bootstrap branch.
I made no changes to any files, just cloned a project.
I have no idea what is going on here. Here is a debug log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build:universal:aot' ]
2 info using npm@5.5.1
3 info using node@v8.9.3
4 verbose run-script [ 'prebuild:universal:aot',
4 verbose run-script 'build:universal:aot',
4 verbose run-script 'postbuild:universal:aot' ]
5 info lifecycle angular-webpack2-starter@3.0.0prebuild:universal:aot: angular-webpack2-starter@3.0.0
6 info lifecycle angular-webpack2-starter@3.0.0
build:universal:aot: angular-webpack2-starter@3.0.0
7 verbose lifecycle angular-webpack2-starter@3.0.0build:universal:aot: unsafe-perm in lifecycle true
8 verbose lifecycle angular-webpack2-starter@3.0.0
build:universal:aot: PATH: my_dir/angular-webpack2-starter/node_modules/.bin:my_webstorm_dir/angular-webpack2-starter/node_modules/.bin:my_dir/.config/yarn/link/node_modules/.bin:my_dir/angular-webpack2-starter/node_modules/.bin:my_dir/.config/yarn/link/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/bin/node_modules/npm/bin/node-gyp-bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle angular-webpack2-starter@3.0.0build:universal:aot: CWD: /Users/ausa/WebstormProjects/bootstrap universal starter/angular-webpack2-starter
10 silly lifecycle angular-webpack2-starter@3.0.0
build:universal:aot: Args: [ '-c', 'npm-run-all -p build:aot build:server:aot' ]
11 silly lifecycle angular-webpack2-starter@3.0.0build:universal:aot: Returned: code: 1 signal: null
12 info lifecycle angular-webpack2-starter@3.0.0
build:universal:aot: Failed to exec build:universal:aot script
13 verbose stack Error: angular-webpack2-starter@3.0.0 build:universal:aot: npm-run-all -p build:aot build:server:aot
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid angular-webpack2-starter@3.0.0
15 verbose cwd /Users/ausa/WebstormProjects/bootstrap universal starter/angular-webpack2-starter
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build:universal:aot"
18 verbose node v8.9.3
19 verbose npm v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error angular-webpack2-starter@3.0.0 build:universal:aot: npm-run-all -p build:aot build:server:aot
22 error Exit status 1
23 error Failed at the angular-webpack2-starter@3.0.0 build:universal:aot script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

@usachev-dev usachev-dev changed the title Error in AOT build: Cannot find module './ngfactory/app/server.app.module.ngfactory'. Error in universal:AOT build: Cannot find module './ngfactory/app/server.app.module.ngfactory'. Jan 25, 2018
@Phoscur
Copy link

Phoscur commented Mar 17, 2018

Got the same problem, would appreciate any solution or hints @qdouble

@Phoscur
Copy link

Phoscur commented Mar 17, 2018

@usachev-dev replace server.aot.ts:9 with

import { ServerAppModuleNgFactory } from './app/server.app.module.ngfactory';

This solves the error and gets the command to work :)

@qdouble
Copy link
Owner

qdouble commented Mar 18, 2018

@Phoscur cool, will try out your solution and make a commit if it works... I just got back to updating the repo a couple days ago

qdouble added a commit that referenced this issue Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants