angular-seo
angular-seo copied to clipboard
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
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.
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!`
Update angular cli version to 1.2.6 and go ahead !!!
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.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 ]
Dear @KrGyan
I installed npm install -g @angular/cli
.
But it occurs same error. How can I fix it?
Regards, Alex
Thanks @KrGyan ! its work when update cli to 1.2.6
hmm, I updated cli to 1.3.1 But it doesn't still work for me. what' the reason?
@alexandra1030 pls use 1.2.6 version and reinstall
@SkMamtajuddin oh, yeah, i'll try it. 👍
@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
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.
i updated my local angular cli to 1.2.6.
its worked
I am using angular5.Me also getting this issue
@akilmakda thank you!it really work for me