angular-cli 1.6.4报错:Error: Cannot find module '@angular-devkit/core'
安装angular 1.6.4后,在使用ng新建项目时报错:
$ng new demo
> module.js:540
> throw err;
> ^
>
> Error: Cannot find module '@angular-devkit/core'
> at Function.Module._resolveFilename (module.js:538:15)
> at Function.Module._load (module.js:468:25)
> at Module.require (module.js:587:17)
> at require (internal/module.js:11:18)
> at Object.<anonymous> (C:\Users\xxx\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\tree\virtual.js:10:16)
> at Module._compile (module.js:643:30)
> at Object.Module._extensions..js (module.js:654:10)
> at Module.load (module.js:556:32)
> at tryModuleLoad (module.js:499:12)
> at Function.Module._load (module.js:491:3)
按错误的提示,应该是angular cli安装时没有安装@angular-devkit/core。
重新安装@angular-devkit/core:
npm i --save-dev @angular-devkit/core