angular-seo icon indicating copy to clipboard operation
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

Open mzaidse opened this issue 7 years ago • 13 comments

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.

mzaidse avatar Aug 07 '17 11:08 mzaidse

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!`

SkMamtajuddin avatar Aug 09 '17 11:08 SkMamtajuddin

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

KrGyan avatar Aug 09 '17 13:08 KrGyan

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 ]

luomu172 avatar Aug 12 '17 04:08 luomu172

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

Regards, Alex

ghost avatar Aug 18 '17 02:08 ghost

Thanks @KrGyan ! its work when update cli to 1.2.6

SkMamtajuddin avatar Aug 18 '17 10:08 SkMamtajuddin

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

ghost avatar Aug 18 '17 10:08 ghost

@alexandra1030 pls use 1.2.6 version and reinstall

SkMamtajuddin avatar Aug 18 '17 10:08 SkMamtajuddin

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

ghost avatar Aug 18 '17 10:08 ghost

@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

JohannesFerner avatar Nov 13 '17 23:11 JohannesFerner

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.

akilmakda avatar Jan 06 '18 11:01 akilmakda

i updated my local angular cli to 1.2.6.

its worked

chozharajan avatar Feb 27 '18 05:02 chozharajan

I am using angular5.Me also getting this issue

kamalakkanni avatar Mar 01 '18 06:03 kamalakkanni

@akilmakda thank you!it really work for me

Mr-Plants avatar Mar 27 '18 01:03 Mr-Plants