LoginSignup
3
3

More than 5 years have passed since last update.

angular-cliで'Cannot find module '@angular-devkit/core'のエラーが出るようになった。

Posted at

エラー内容

$ ng --version
Error: Cannot find module '@angular-devkit/core'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/homahi/workspace/rxjs/node_modules/@angular-devkit/schematics/src/tree/virtual.js:10:16)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

いつの間にかエラーが出るようになった

yarn時にもwarningが出てる

warning "@schematics/angular@0.1.16" has unmet peer dependency "@angular-devkit/core@0.0.28".
warning "@angular-devkit/schematics@0.0.51" has unmet peer dependency "@angular-devkit/core@0.0.28".

対策

Angular-Cliをバージョンアップ

$ npm uninstall -g @angular-cli
$ npm cache verify
$ npm install -g @angular/cli@latest

治った

% ng --version                                                                                                                                                                    ~/workspace homahi-2

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.5
Node: 8.1.2
OS: darwin x64
Angular: 
...

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3