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
thnx guys npm install @angular-devkit/core --save-dev , it worked for me
@merobal Thank you! Worked for me!
I struggled with the same problem. 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.
Error: Cannot find module '@angular-devkit/core'
npm install @angular-devkit/core --save-dev
its working fine