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 a lot..! It worked..!!! npm install

simoutn avatar Jul 18 '18 06:07 simoutn

Thanks: LarsMengel. Your solution worked like a charm.

krishna-suman avatar Jul 31 '18 19:07 krishna-suman

i got this error when i wanted to use my global ng‍‍‍ and create new angular project, this solved my problem: sudo npm i -g @angular-devkit/core

FatemeFazli avatar Aug 07 '18 09:08 FatemeFazli

@FatemeFazli Yeah that is exactly what I did, all the other solutions did not work for me.

jbernard1 avatar Aug 08 '18 14:08 jbernard1

run npm install

JeanLLopes avatar Aug 12 '18 05:08 JeanLLopes

For Angular 6 you need to install/update @angular/cli, @angular-devkit/build-angular, @angular/compiler, and @angular/compiler-cli.

npm i --save-dev @angular/cli @angular-devkit/build-angular @angular/compiler @angular/compiler-cli

Running npm update after is probably another good idea.

spronkets avatar Aug 31 '18 05:08 spronkets

@LarsMengel Just run with the same issue, I followed your guide and edited from "1.7.4" to "^1.7.4" then updated. It worked 💯 Thank you for your great solution!

hewity avatar Sep 10 '18 02:09 hewity

@LarsMengel thank you!

ivan-khuda avatar Oct 05 '18 00:10 ivan-khuda

@tienthanhjlw Thank you. Now working.

bipon68 avatar Oct 23 '18 05:10 bipon68

Only need run : npm i -D @angular-devkit/core

thankyou

Dipak84 avatar Jan 03 '19 07:01 Dipak84

@LarsMengel 's solution alone didin't solve since I was at a lower angular/cli: I had to update from: "@angular/cli": "1.5.2", to: "@angular/cli": "^1.6.4",

ishandutta2007 avatar Apr 08 '19 02:04 ishandutta2007

@LarsMengel thanks for the solution. Very helpful

lehone-hp avatar May 07 '19 12:05 lehone-hp

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.