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 ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\Users\Muhammad Zaid\IdeaProjects\angular-seo\src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts #10

Open
mzaidse opened this issue Aug 7, 2017 · 13 comments

Comments

@mzaidse
Copy link

mzaidse commented Aug 7, 2017

After cloning your repository, I installed dependencies using 'npm install', then I run the command 'npm start' and faced this error. Kindly help me.

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'C:\Users\Muhammad Zaid\IdeaProjects\angular-seo\src'
 @ ./src/main.ts 4:0-74
 @ multi ./src/main.ts
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prestart: `ng build --prod && ngc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@SkMamtajuddin
Copy link

Same here
`ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/skmamtajuddin/workspace/ngseo/FrapSeo/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.9.2
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] prestart: ng build --prod && ngc
npm ERR! Exit status 1
npm ERR!`

@KrGyan
Copy link

KrGyan commented Aug 9, 2017

Update angular cli version to 1.2.6 and go ahead !!!

@luomu172
Copy link

Same here

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 verbose lifecycle [email protected]
prestart: unsafe-perm in lifecycle true
7 verbose lifecycle [email protected]prestart: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\work\code\webStormCode\angular-seo\node_modules.bin;C:\Program Files (x86)\Common Files\NetSarang;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;%JAVA_HOME%\bin;C:\Program Files\TortoiseSVN\bin;D:\javaEnvironmental\TortoiseGit\bin;D:\javaEnvironmental\apache-maven-3.3.9\bin;C:\Python27\Scripts;D:\HashiCorp\Vagrant\bin;C:\Program Files\nodejs;C:\Users\Administrator\AppData\Roaming\npm;D:\javaTools\qshell
8 verbose lifecycle [email protected]
prestart: CWD: D:\work\code\webStormCode\angular-seo
9 silly lifecycle [email protected]prestart: Args: [ '/d /s /c', 'ng build --prod && ngc' ]
10 silly lifecycle [email protected]
prestart: Returned: code: 1 signal: null
11 info lifecycle [email protected]~prestart: Failed to exec prestart script
12 verbose stack Error: [email protected] prestart: ng build --prod && ngc
12 verbose stack Exit status 1
12 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:289:16)
12 verbose stack at emitTwo (events.js:125:13)
12 verbose stack at EventEmitter.emit (events.js:213:7)
12 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
12 verbose stack at emitTwo (events.js:125:13)
12 verbose stack at ChildProcess.emit (events.js:213:7)
12 verbose stack at maybeClose (internal/child_process.js:927:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
13 verbose pkgid [email protected]
14 verbose cwd D:\work\code\webStormCode\angular-seo
15 verbose Windows_NT 6.1.7601
16 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "start"
17 verbose node v8.3.0
18 verbose npm v5.3.0
19 error code ELIFECYCLE
20 error errno 1
21 error [email protected] prestart: ng build --prod && ngc
21 error Exit status 1
22 error Failed at the [email protected] prestart script.
22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 1, true ]

@ghost
Copy link

ghost commented Aug 18, 2017

Dear @KrGyan
I installed npm install -g @angular/cli.
But it occurs same error. How can I fix it?

Regards,
Alex

@SkMamtajuddin
Copy link

Thanks @KrGyan ! its work when update cli to 1.2.6

@ghost
Copy link

ghost commented Aug 18, 2017

hmm, I updated cli to 1.3.1 But it doesn't still work for me. what' the reason?

@SkMamtajuddin
Copy link

@alexandra1030 pls use 1.2.6 version and reinstall

@ghost
Copy link

ghost commented Aug 18, 2017

@SkMamtajuddin oh, yeah, i'll try it. 👍

@JohannesFerner
Copy link

JohannesFerner commented Nov 13, 2017

@SkMamtajuddin @alexandra1030
I was on 1.5.0 (global); Downgraded to 1.2.6 (global) ...
be aware of

$ ng -version
Your global Angular CLI version (1.2.6) is greater than your local
version (1.0.3). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".

so do not update via -g but update the local version.

Then it worked for me

@akilmakda
Copy link

run :npm install [email protected]

in your pakage.json file.. in script tag replace this "ng build --prod" with "ng build --env=prod". It will reolve the problem.

@chozharajan
Copy link

i updated my local angular cli to 1.2.6.

its worked

@kamalakkanni
Copy link

I am using angular5.Me also getting this issue

@Mr-Plants
Copy link

@akilmakda thank you!it really work for me

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

9 participants