Angular2 CLI错误“@ angular / compiler-cli”包未正确安装

前端之家收集整理的这篇文章主要介绍了Angular2 CLI错误“@ angular / compiler-cli”包未正确安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在做一个Angular 2项目.现在尝试在当前项目中安装Angular CLI,具体如下
npm install --save-dev @angular/cli@latest
npm install

问题是运行ng服务时收到错误

The "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.
    at Object.<anonymous> (/myng2project/node_modules/@ngtools/webpack/src/index.js:14:11)
    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)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/myng2project/node_modules/@angular/cli/tasks/eject.js:10:19)
    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)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
版本有问题
"@angular/cli": "1.0.0-rc.4"

尝试安装较旧的

"@angular/cli": "1.0.0-rc.2"

猜你在找的Angularjs相关文章