Cannot find module '@angular-devkit/core'

JavascriptAngularEcmascript 6Angular Cli

Javascript Problem Overview


I have created a angular project with Angular CLI: 1.6.3 Node: 9.4.0 OS: linux x64 version. But when want to run my angular app with command ng serve then fetch this error

> Cannot find module '@angular-devkit/core'.

Javascript Solutions


Solution 1 - Javascript

Try the following steps,

Step 1:

npm update -g @angular/cli

Step 2:

Edit your package.json changing the line

"@angular/cli": "1.6.0",

to

"@angular/cli": "^1.6.0",

STEP 3:

npm update

Refer the steps

Solution 2 - Javascript

Step1: Edit your package.json changing the line

@angular/cli": "1.6.4"

to

@angular/cli": "^1.6.4"

Step2:

npm update -g @angular/cli 

Step3:

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

I was facing the exact same problem. These three did the tasks for me. You may like to see https://github.com/angular/angular-cli/issues/9307

Solution 3 - Javascript

try this out

npm install @angular-devkit/core --save-dev

https://github.com/angular/devkit/issues/256

try to update your angular cli

https://github.com/angular/angular-cli/issues/9307

Solution 4 - Javascript

This can happen on different versions on angular-cli. You can install it manually with

 npm i -D @angular-devkit/core 

> -D is shortcut to --save-dev

Or try the latest version of angular cli

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

Solution 5 - Javascript

package.json, change to "@angular/cli": "^1.6.5",

 "devDependencies": {
"@angular/cli": "^1.6.5",
"@angular/compiler-cli": "^5.0.0",

Important, the version could be vary depends on what time.

You really should run

 npm update -g @angular/cli 

first, to get version, my is 1.6.5

What does the "^" do?

 ~1.0.2 means to install version 1.0.2 or the latest patch version such as 1.0.4. 

  ^1.0.2 means to install version 1.0.2 or the latest minor or patch version such as 1.1.0.

last, run this

   npm update

Solution 6 - Javascript

Just run:

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

In the project folder, to fix it.

Solution 7 - Javascript

I did it by deleting package-lock.json and the node_modules folder. After that run "npm install" and start the application again.

Solution 8 - Javascript

You can do

First,

Delete the node_modules folder

Run npm install

And add devkit to your dev dependancies with npm i -D @angular-devkit/core

Solution 9 - Javascript

Step 1: delete package-lock.json Step 2: npm update -g @angular/cli Step 3: update @angular/cli new version in package.json Step 4: npm install

It worked for me.

Solution 10 - Javascript

I only installed my angular/cli using:
npm install -g @angular/[email protected]
And I started getting this error.

Solution:
If your version is global and
If you don't mind the version of your angular/cli then type:
npm update -g @angular/cli

Solution 11 - Javascript

for me adding @angular-devkit/core solved the issue

npm install --save-dev @angular-devkit/core

Solution 12 - Javascript

I had this same error after updating some packages.

In my package.json I had the most current '@angular-devkit/core'

Using the standard solution to many problems:

rm -R node_modules/
npm install

And I updated the @angular/cli

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

and finally:

npm start

Solution 13 - Javascript

Only change "@angular/cli": "1.6.4", to "@angular/cli": "^1.6.4", and update npm with: npm update

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionazmul hossainView Question on Stackoverflow
Solution 1 - JavascriptSajeetharanView Answer on Stackoverflow
Solution 2 - Javascriptkrishna murariView Answer on Stackoverflow
Solution 3 - JavascriptinyeeView Answer on Stackoverflow
Solution 4 - JavascriptalexKhymenkoView Answer on Stackoverflow
Solution 5 - JavascripthoogwView Answer on Stackoverflow
Solution 6 - JavascriptJMckView Answer on Stackoverflow
Solution 7 - JavascriptRamon-Alexandru SalageanView Answer on Stackoverflow
Solution 8 - JavascripttolotraView Answer on Stackoverflow
Solution 9 - JavascriptArvind MehtaView Answer on Stackoverflow
Solution 10 - JavascriptdaniloView Answer on Stackoverflow
Solution 11 - JavascriptdasAnderl ausMingaView Answer on Stackoverflow
Solution 12 - JavascriptGustavo MarceloView Answer on Stackoverflow
Solution 13 - JavascriptMojtaba NavaView Answer on Stackoverflow