angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Error: Cannot find module '@angular-devkit/core' - after clean install

Open ghost opened this issue 8 years ago • 113 comments

Versions


    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.4
Node: 6.11.0
OS: win32 x64
Angular: _(yup, I don't see it, but I install it 2 days ago)_
...

Repro steps

  • ng new e-commerce-with-tut-ng4
  • cd e-commerce-with-tut-ng-4
  • ng serve (to test if works)

Observed behavior

After that I've got this ->

C:\Users\TheTanadu\Desktop\codetemp\e-commerce-with-tut-ng4>ng serve
module.js:471
    throw err;
    ^

Error: Cannot find module '@angular-devkit/core'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\TheTanadu\Desktop\codetemp\e-commerce-with-tut-ng4\node_modules\@angular-devkit\schematics\src\tree\virtual.js:10:16)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

After all I came here but when I wanted to use ng --version in this path I've got same error like that what is up and I had to go cd .. and then use ng -v

Desired behavior

I wanted to see local server

Mention any other details that might be useful (optional)

Windows 10

ghost avatar Jan 21 '18 16:01 ghost

Thanks @LarsMengel

strived avatar Jan 28 '18 01:01 strived

@tienthanhjlw solution fixed the issue, I am using CLI 1.6.6

BhanuPrakash531 avatar Jan 28 '18 10:01 BhanuPrakash531

Thank you @LarsMengel

surasakgame7 avatar Jan 28 '18 11:01 surasakgame7

@tienthanhjlw thank you buddy! That did the trick. Just wondering why this is needed...

caiusCitiriga avatar Jan 28 '18 11:01 caiusCitiriga

@LarsMengel you're a hero man!! Thanks 👍

parrainc avatar Jan 28 '18 22:01 parrainc

Thank you @LarsMengel :+1:

umapatik avatar Jan 29 '18 06:01 umapatik

Thanks @tienthanhjlw

rpalvair avatar Jan 29 '18 12:01 rpalvair

@tienthanhjlw Thank you, saved my day. For me what worked was the same with the global option. So ng new would work.

npm i -g @angular-devkit/core

elpdrc avatar Jan 29 '18 14:01 elpdrc

Thank you @LarsMengel !!!!

jmsbrett avatar Jan 29 '18 14:01 jmsbrett

Think you a lot @tienthanhjlw, your command worked for me.

AMAKESRI avatar Jan 29 '18 15:01 AMAKESRI

oh ! " juron " ça marche !!! Thank you @LarsMengel !!!

ralexandre75 avatar Jan 29 '18 16:01 ralexandre75

@LarsMengel I love you xD, thank you very much!!!!

HigorSenna avatar Jan 30 '18 00:01 HigorSenna

Thank you! also had the problem and that fixed it!

aimeetacchi avatar Feb 01 '18 11:02 aimeetacchi

Thanks a lot!!! @LarsMengel

iykeprince avatar Feb 03 '18 07:02 iykeprince

thank you!!!! i tried to figure it out for hours!!!! @LarsMengel

RachelHir avatar Feb 05 '18 14:02 RachelHir

I follow @LarsMengel 's instructions and got me out from the issue. Thanks for sharing this input with the community Lars!!!

DeanMcAndrews avatar Feb 06 '18 05:02 DeanMcAndrews

Thanks @LarsMengel

ammarsani-my avatar Feb 07 '18 04:02 ammarsani-my

It`s a matter of updating angular/cli version. As @merobal pointed in: https://github.com/angular/devkit/issues/256#issuecomment-359419157.

ViniciusBVilar avatar Feb 07 '18 19:02 ViniciusBVilar

Was facing the similar issue :

Updated the @angular/cli with below version , and this fixed the issue :

"devDependencies": { "@angular/cli": "^1.6.5",

itsSandeepNandey avatar Feb 08 '18 04:02 itsSandeepNandey

I have this issue today and updated my package.json to 1.6.8 and everything work's fine.

horochovec avatar Feb 09 '18 04:02 horochovec