Error: Cannot find module '@angular-devkit/core' - after clean install
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
I struggled with the same problem just a minute ago. My project was generated using the v 1.6.0 of angular-cli.
- npm update -g @angular/cli
- editing my package.json changing the line "@angular/cli": "1.6.0", to "@angular/cli": "^1.6.0",
- npm update did the trick.
gosh thank you @LarsMengel :D That did it.
I have the same issue with version 1.6.4. @LarsMengle this works because latest patch version is used 1.6.5. My problem is that 1.6.5 increased the prod build from 9minutes to 30 minutes
Thanks @LarsMengel , I am struggling from last 2 days. Now the issue resolved!!
The same with my 1.5.2 version.
I just started learning Angular a few days ago and this came up for the first time just now. Thanks @LarsMengel !
Thank you @LarsMengel! Just ran into the same thing with 1.6.4. Solution worked like a charm.
I am using angular 1.6.5 for cli. In the examples from angular documentation: https://angular.io/tutorial/toh-pt6
In my package.json I change
original:
"@angular/cli": "1.5.0",
new:
"@angular/cli": "^1.5.0",
What does the "^" do exactly?
@jadeite100: Check out this link.
Excerpt:
So if you see
~1.0.2it means to install version1.0.2or the latest patch version such as1.0.4. If you see^1.0.2it means to install version1.0.2or the latest minor or patch version such as1.1.0.
Thank you @LarsMengel.
@LarsMengel. Thanks alot, Its works for me..
@LarsMengel thank you very much. Was stuck few hours this morning trying to do this with VSTS
Was this issue from yesterday onwards because we do see that this error is poping up suddenly from today?
Seems so. I suspect for some reasons "angular-devkit/core" hasn´t been downloaded during the "ng new" process. Updating all the packages did the trick. Would be interesting to know the reason.
Yes for us just updating @angular/cli did the trick
Solved by updating to 1.6.5
Does anybody have the link to download the code for the book? I brought the "ng-book: The Complete Guide to Angular 4 " on amazon.com but I can't see any link to download the code for the book?
Dude, I just wanted to thank you. I faced this similar error using CLI version 1.6.4, but using your instructions and updating to CLI 1.6.5, the error was gone and I got successful compilation. Thank you, sir!
Thanks @LarsMengel that solution worked out for me. 👍
thanks @LarsMengel had same problem and that fixed it.