angular-cli: 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
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 203
- Comments: 114 (2 by maintainers)
Commits related to this issue
- Updated angular version due to https://github.com/angular/angular-cli/issues/9307 — committed to atereshkov/DiberWebClient by deleted user 6 years ago
- Updated angular cli version due to angular/angular-cli#9307 fixes #796 — committed to arkime/arkime by deleted user 6 years ago
- changed the cli after update module errors Error: Cannot find module '@angular-devkit/core' - after clean install; https://github.com/angular/angular-cli/issues/9307 — committed to gerrymcdonnell/testrestapi by gerrymcdonnell 6 years ago
- Fix dependencies for angular/cli Should fix #1196 As explained in the above issue we were getting: ``` Running ['/home/lefteris/.npm-global/bin/npm', 'run', 'build:prod'] in '/home/lefteris/ew/raid... — committed to LefterisJP/raiden by LefterisJP 6 years ago
- Fix dependencies for angular/cli Should fix #1196 As explained in the above issue we were getting: ``` Running ['/home/lefteris/.npm-global/bin/npm', 'run', 'build:prod'] in '/home/lefteris/ew/raid... — committed to LefterisJP/raiden by LefterisJP 6 years ago
- Fix dependencies for angular/cli Should fix #1196 As explained in the above issue we were getting: ``` Running ['/home/lefteris/.npm-global/bin/npm', 'run', 'build:prod'] in '/home/lefteris/ew/raid... — committed to raiden-network/raiden by LefterisJP 6 years ago
- Fix bug related to angular cli bug: https://github.com/angular/angular-cli/issues/9307 — committed to Samoxive/SafetyJim-Client by Samoxive 6 years ago
- fixed angular bug (https://github.com/angular/angular-cli/issues/9307) — committed to caseydwayne/angular5-app by caseydwayne 6 years ago
- Fixed studio build: https://github.com/angular/angular-cli/issues/9307 — committed to finos/plexus-interop by nikoant 6 years ago
- Merge pull request #51 in AAP/plexus-interop from feature/Fix_studio_build to develop * commit '77c88cb4d712f0c6171d5df885e4f06b592430ad': Fixed web build Fixed studio build: https://github.com/a... — committed to finos/plexus-interop by nikoant 6 years ago
- Merge pull request #15 in AAP/plexus-interop-github-staging from AAP/plexus-interop:develop to Bugfixes_in_desktop_and_web_brokers * commit 'fe71516f00611558add90c5d6e5f07dac12cca09': (29 commits) ... — committed to finos/plexus-interop by svyatoslav-kryukov-db 6 years ago
- Fixes: https://github.com/angular/angular-cli/issues/9307 — committed to vivekimsit/angular-realworld-example-app by vivekimsit 6 years ago
- Fixes: https://github.com/angular/angular-cli/issues/9307 — committed to gothinkster/angular-realworld-example-app by vivekimsit 6 years ago
- Merge pull request #52 in AAP/plexus-interop from AAP/plexus-interop-github-staging:master to master * commit '70257a6b84bf47078b07b1f77f00c9a3385d4219': (29 commits) Fixed web build Fixed studio... — committed to finos/plexus-interop by nikoant 6 years ago
- fix: Updating angular/cli to 1.6.7. This fixes an issue (https://github.com/angular/angular-cli/issues/9307) with building with aot flag — committed to raymondkarstensen/ngx-mime by raymondkarstensen 6 years ago
- fix (ui): angular/cli fix from https://github.com/angular/angular-cli/issues/9307 Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com> — committed to ovh/cds by yesnault 6 years ago
- fix (ui): angular/cli (#2158) fix from https://github.com/angular/angular-cli/issues/9307 Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com> — committed to ovh/cds by yesnault 6 years ago
- Updated angular/cli to 1.6.8 The version 1.6.1 has a issue with a missing @angular-devkit/core package. https://github.com/angular/angular-cli/issues/9307 — committed to sudobinbash/samples-js-angular by sudobinbash 6 years ago
- Updated angular/cli to 1.6.8 The version 1.6.1 has a issue with a missing @angular-devkit/core package. https://github.com/angular/angular-cli/issues/9307 — committed to okta/samples-js-angular by sudobinbash 6 years ago
- fix volgens https://github.com/angular/angular-cli/issues/9307 — committed to pyoss-org/pyossfrontend by Drareeg 6 years ago
I struggled with the same problem just a minute ago. My project was generated using the v 1.6.0 of angular-cli.
Only need run 👍 :
npm i -D @angular-devkit/core
gosh thank you @LarsMengel 😄 That did it.
@jadeite100: Check out this link.
Excerpt:
Solved by updating to 1.6.5
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?
this is correct solution
npm install @angular-devkit/core --save-dev
https://github.com/angular/devkit/issues/256
npm i npm@latest -g
I think the correct way is to add the following to the dev-deps:
"@angular-devkit/build-angular": "^0.6.1",
Or execute:
npm install --save-dev @angular-devkit/build-angular
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
An update to version 1.6.5 seems to fix the issue
npm update -g @angular/cli
Angular CLI: 1.6.5 Node: 6.11.3 OS: win32 x64 Angular: 5.2.1 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, router
The same with my 1.5.2 version.
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
ha, ty guys… kept following all the comments and tada some magic happens and it is fixed now…
I did
npm install @angular-devkit/core
also added them to package json manually"@angular-devkit/core": "0.4.8",
and didnpm update
Hang on now. So obviously, updating angular-cli fixes the issue, but it appears that 1.5.0 to 1.6.4 suffered this problem. How did so many versions get released that wouldn’t even
ng serve
?Thanks @LarsMengel I had to re-run npm install and problem solved. The reason being i was getting error “Your global Angular CLI version is greater than your local” while running npm update.
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.Having an old project (e.g. 1.5.4):
Now
ng update @angular/cli
has no chance at all and will fail:Simplest possible solution. Do this AGAIN:
Now
ng update @angular/cli
will work as expected.@LarsMengel Great. Did the trick. Thanks man
I had the same Problem. I solved by below command npm update -g @angular/cli
@mehany No update necassary, cause ‘^’ will take the newest version anyway.
I can verify the solution still works, had the same problem this moring 👍
npm install --save-dev @angular/cli@latest
fixed the issue for me.
I have this issue today and updated my package.json to 1.6.8 and everything work’s fine.
@tienthanhjlw fixed for me too, I am using v1.6.3
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.
@FatemeFazli Yeah that is exactly what I did, all the other solutions did not work for me.
@tienthanhjlw Thank you, saved my day. For me what worked was the same with the global option. So
ng new
would work.Thanks @tienthanhjlw