gpt4 book ai didi

Angular2 beta 11 'npm install' 警告 npm peerDependencies

转载 作者:太空狗 更新时间:2023-10-29 17:10:17 25 4
gpt4 key购买 nike

刚刚安装了 Angular2 beta 11 npm install angular2 --save 并收到以下警告:

d:\Projects\sample>npm install angular2 --save
sample@1.0.0 d:\Projects\sample
+-- angular2@2.0.0-beta.11
+-- UNMET PEER DEPENDENCY es6-promise@^3.0.2
+-- UNMET PEER DEPENDENCY es6-shim@^0.35.0
+-- UNMET PEER DEPENDENCY reflect-metadata@0.1.2
+-- UNMET PEER DEPENDENCY rxjs@5.0.0-beta.2
`-- UNMET PEER DEPENDENCY zone.js@^0.6.4

npm WARN angular2@2.0.0-beta.11 requires a peer of es6-promise@^3.0.2 but none was installed.
npm WARN angular2@2.0.0-beta.11 requires a peer of es6-shim@^0.35.0 but none was installed.
npm WARN angular2@2.0.0-beta.11 requires a peer of reflect-metadata@0.1.2 but none was installed.
npm WARN angular2@2.0.0-beta.11 requires a peer of rxjs@5.0.0-beta.2 but none was installed.
npm WARN angular2@2.0.0-beta.11 requires a peer of zone.js@^0.6.4 but none was installed.

以前的 Angular2 版本在 main package.js 但现在不是。

"dependencies": {
"angular2": "^2.0.0-beta.11"
}

我检查了 ..\node_modules\angular2\package.json 并且可以看到它依赖于这些包:

    "peerDependencies": {
"es6-promise": "^3.0.2",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "^0.6.4"
},

有什么想法吗?

最佳答案

npm install angular2 --save 失败后,我用这个命令成功安装了 angular2:

npm install --save rxjs@5.0.0-beta.6 reflect-metadata@0.1.2 zone.js es6-shim angular2@2.0.0-beta.17

如果我们得到 UNMET PEER DEPENDENCY 那么 - 在清除 node_modules 文件夹并从 package.json 中删除依赖项之后 - 我们可以做两件事:

  • 安装较早版本的angular2
  • 手动安装缺少的依赖项

关于Angular2 beta 11 'npm install' 警告 npm peerDependencies,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36095260/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com