【问题标题】:Can't create project via angular-cli in windows无法通过 windows 中的 angular-cli 创建项目
【发布时间】:2017-02-25 06:03:29
【问题描述】:

当我尝试使用命令安装angular-cli

npm install -g angular-cli 

我收到以下错误,

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package @angular/compiler@2.1.0 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer @angular/compiler-cli@0.6.4 wants @angular/compiler@2.0.2
npm ERR! peerinvalid Peer @angular/platform-server@2.1.0 wants @angular/compiler@2.1.0

npm ERR! Please include the following file with any support request:
npm ERR!     C:\WINDOWS\system32\npm-debug.log

我应该怎么做才能解决这个问题?

【问题讨论】:

    标签: angularjs node.js angular npm


    【解决方案1】:

    看起来像依赖解析的问题。最新版本的 Node 可以处理的一些依赖项会导致旧版本出错。

    1. 下载并安装最新的NodeJS版本(6.8.1),
    2. 再次运行npm install...
    3. 运行npm rebuild

    【讨论】:

    • 这很有帮助。在几次失败的尝试之后,我正要离开它并专注于 Angular 1.x。
    • npm rebuild 不是完成这项工作所必需的。
    猜你喜欢
    • 2017-08-14
    • 1970-01-01
    • 2023-03-11
    • 1970-01-01
    • 1970-01-01
    • 2019-03-06
    • 1970-01-01
    • 2022-10-05
    相关资源
    最近更新 更多