bug(schematics): Cannot find module '@angular-devkit/core'
Bug Report or Feature Request (mark with an x)
- [X ] bug report -> please search issues before submitting
- [ ] feature request
Area
- [ ] devkit
- [X ] schematics
Versions
node 6.9.1 npm 5.4.2 Windows 10
Repro steps
If you globally install @angular-devkit/schematics and try to create a new schematic using
schematics @schematics/schematics:schematic --name=SomeSchematicName you will get the following error:
The log given by the failure
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:\......\node_modules\@schematics\schematics\schematic\factory.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)
Desired functionality
No errors and a generated new schematics blueprint
Mention any other details that might be useful
the @schematics/schematics:schematic factory uses a dependency on @angular-devkit/core, but this dependency is not in the package.json
Yea same issue here, after uninstalling angular-cli then after installing the latest angular-cli,
ng help boom this
npm install -g @angular-devkit/core fixed it anyway
related to this angular/angular-cli#9190
@theo4u
So should I just add it to my package.json if angular-cli uses it internally? Because we don't use this module in our code base.
@jainmitesh09 Oh can't really say, since it's in the pkgjson . https://github.com/angular/angular-cli/blob/9c871b003a8d91051e9d7affc63206aef4b71e20/package.json#L45
But i added it to mine to stop the error when running local commands like ng serve --> npm install @angular-devkit/core --save-dev
Same here. As a quick fix npm i -D @angular-devkit/core in the project folder fixed it for me.
I rolled back to angular-cli 1.6.3
It seems that some dependencies became peerDependencies. :(
But restarting from scratch now works because of newer version just deployed
Taking @germs12 advice, I rolled back to 1.6.3. But then I re-installed 1.6.4 and everything seems to be working again.
I don't know what happened, I got the same error during npm install ~1 hour ago, but now everything worked fine again (without any change from my side meantime).
There was indeed a bad release about 1h ago but we've since rolled back and republished the previous version while we work on a real fix.
See angular/angular-cli#9276
@hansl This ticket was about schematics, not the devkit / cli
Sorry, i just wanted to add the following as context:
We just released an emergency patch for the devkit and are working to release a patch for 1.4 and 1.5 that will fix this retroactively. After this we will re-release the CLI and the devkit.
I've cleared everything out and reinstalled. So far nothing is working. I have a feeling it's due to some cached version of the CLI on my computer.
Amusing part of this for me is this: I was researching the problem for an issue in AWS CodeBuild. Fixed that, but now I can't get ng to work on my local machine!
Thanks @hansl for you and your teams work.
I should have checked this a minute ago before upgrading. :(
Does anyone know what is the latest working version?
After upgrading, I got the error for missing devkit. Installed it. And now I have this error.

@germs12 just run this command in your prompt ""npm install -g @angular-devkit/core"" i think it will fix your problem
@germs12 Uninstalling latest and install
npm install -g @angular/[email protected] @angular-devkit/core
worked for me. At least until a fix to current bug.
@nnennajohn : Did not worked for me...
For me
npm install @angular-devkit/core --save-dev
did the trick.
For me this is like the fifth time during the past 3 months that the community around npm & angular managed to somehow break the fundamental rule of any sane package repository: the published versions never ever change. If I have a package.json with only fixed versions and I don't modify the code, then my builds should work every single day. How am I supposed to deliver a software package, if I cannot guarantee it will even build on a random day?
@nnennajohn Not working for me npm install @angular-devkit/core