devkit icon indicating copy to clipboard operation
devkit copied to clipboard

bug(schematics): Cannot find module '@angular-devkit/core'

Open meDavid opened this issue 9 years ago • 44 comments

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

meDavid avatar Nov 03 '17 10:11 meDavid

thnx guys npm install @angular-devkit/core --save-dev , it worked for me

ashits8118 avatar Feb 05 '18 17:02 ashits8118

@merobal Thank you! Worked for me!

ViniciusBVilar avatar Feb 07 '18 17:02 ViniciusBVilar

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.

sabbarbutt avatar Mar 26 '18 15:03 sabbarbutt

Error: Cannot find module '@angular-devkit/core'

errorcapture

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

runcapture

its working fine

webmasters964 avatar Apr 07 '18 09:04 webmasters964