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

thank u @LarsMengel

mohamedbrahimi avatar Feb 12 '18 01:02 mohamedbrahimi

Thanks @LarsMengel. That was fast and solved my problem.

flashjpr avatar Feb 12 '18 09:02 flashjpr

had same issue....did npm install -g @angular/cli@latest and it resolved.

jbistis avatar Feb 13 '18 00:02 jbistis

Thanks man! Problemo solved!

bevndas avatar Feb 14 '18 06:02 bevndas

Thanks @LarsMengel ! Worked like a charm!

SaadatRizvi avatar Feb 14 '18 10:02 SaadatRizvi

this work for me npm i -D@angular-devkit/core

ghost avatar Feb 14 '18 17:02 ghost

@LarsMengel Thanks ! Worked for me too. Using now Angular ^1.6.8.

yurimalaquias avatar Feb 15 '18 00:02 yurimalaquias

The solution by @LarsMengel worked like a charm.

Thank you!

mpituley avatar Feb 15 '18 22:02 mpituley

npm install --save-dev @angular/cli@latest

fixed the issue for me.

pmesserschmidt avatar Feb 16 '18 08:02 pmesserschmidt

I am having the same issue, for some reason my Angular CLI/npm isn't downloading "node_modules@angular-devkit\core".

To fix it I copied "my node_modules@angular-devkit\core" folder from a 3 month old project into the project that I am trying to create now and that fixed the issue...

MattSkea avatar Feb 16 '18 11:02 MattSkea

I had the same issue and here is how I resolved it ( today ) the current version is 1.7.0 I updated to the latest with

npm update -g @angular/cli

then I removed the project i created with previous version of @angular/cli then I started a new one again with

ng new projectName

@LarsMengel please update your answer

mehany avatar Feb 16 '18 21:02 mehany

@mehany No update necassary, cause '^' will take the newest version anyway.

I can verify the solution still works, had the same problem this moring 👍

Mr-Sloth avatar Feb 19 '18 08:02 Mr-Sloth

I have solved the above issue through this command: npm install --save-dev @angular/cli@latest

chamanbharti avatar Feb 20 '18 10:02 chamanbharti

Thanks ! Works fine !

mauroao avatar Feb 21 '18 14:02 mauroao

It really is an issue with the version, as soon as I updated mine to 1.6.5 (npm install -g @angular/[email protected]) the issue went away!

lisa13 avatar Feb 22 '18 09:02 lisa13

@LarsMengel helped!!, thank you. :+1:

RyzorBent avatar Feb 23 '18 05:02 RyzorBent

Thanks @LarsMengel ... Your solution works like a CHARM ...

berdejitendra14 avatar Mar 02 '18 17:03 berdejitendra14

Thank you @LarsMengel worked like a charm. Thanks a lot.

rdwivedi avatar Mar 08 '18 07:03 rdwivedi

@LarsMengel Thank You for the solution. It worked for me too.

  1. npm update -g @angular/cli
  2. editing package.json changing the line "@angular/cli": "1.x.x" to "@angular/cli": "^1.x.x",
  3. npm update

pratish945 avatar Mar 09 '18 11:03 pratish945

Thanks @LarsMengel !

glvno avatar Mar 10 '18 04:03 glvno