gpt4 book ai didi

Angular 2 : UNMET PEER DEPENDENCY

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

我正在尝试使用此命令在 Angular2 中使用 npm 安装 bootstrap

npm install --save ng2-bootstrap

但我在控制台中收到以下错误和警告

+-- UNMET PEER DEPENDENCY @angular/common@2.0.0-rc.5
+-- UNMET PEER DEPENDENCY @angular/compiler@2.0.0-rc.5
+-- UNMET PEER DEPENDENCY @angular/core@2.0.0-rc.5
+-- UNMET PEER DEPENDENCY @angular/forms@0.3.0
+-- ng2-bootstrap@1.1.1
`-- UNMET PEER DEPENDENCY webpack@^1.9.11

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN extract-text-webpack-plugin@1.0.1 requires a peer of webpack@^1.9.11 but none was installed.
npm WARN ng2-bootstrap@1.1.1 requires a peer of @angular/common@2.0.0-rc.6 but none was installed.
npm WARN ng2-bootstrap@1.1.1 requires a peer of @angular/compiler@2.0.0-rc.6 but none was installed.
npm WARN ng2-bootstrap@1.1.1 requires a peer of @angular/core@2.0.0-rc.6 but none was installed.
npm WARN ng2-bootstrap@1.1.1 requires a peer of @angular/forms@2.0.0-rc.6 but none was installed.

最佳答案

您需要将您的应用程序升级到angular2 RC6版本。

按照这些步骤-

  1. 将package.json 中的@angular 版本更新为2.0.0-rc.6 Refer package.json here

  2. 清理您的 node_modules 文件夹,然后运行 ​​npm install。

看看这是否有帮助。


编辑:

这就是我的 package.json 对于 angular2 RC6 和 ng2-bootstrap 1.1.1 和 angular-cli 的样子

{
"name": "angular2-rc6-cli-ng2bootstrap-8-sep",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"postinstall": "typings install",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "2.0.0-rc.6",
"@angular/compiler": "2.0.0-rc.6",
"@angular/compiler-cli": "0.6.0",
"@angular/core": "2.0.0-rc.6",
"@angular/forms": "2.0.0-rc.6",
"@angular/http": "2.0.0-rc.6",
"@angular/platform-browser": "2.0.0-rc.6",
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
"@angular/platform-server": "2.0.0-rc.6",
"@angular/router": "3.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.6",
"es6-shim": "0.35.1",
"ng2-bootstrap": "^1.1.1",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.11",
"systemjs": "0.19.26",
"zone.js": "^0.6.17"
},
"devDependencies": {
"angular-cli": "1.0.0-beta.10",
"codelyzer": "0.0.20",
"ember-cli-inject-live-reload": "1.4.0",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "0.13.22",
"karma-chrome-launcher": "0.2.3",
"karma-jasmine": "0.3.8",
"protractor": "3.3.0",
"ts-node": "0.5.5",
"tslint": "3.11.0",
"typescript": "2.0.2",
"typings": "1.3.1"
}
}

关于 Angular 2 : UNMET PEER DEPENDENCY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39361903/

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