gpt4 book ai didi

angular - NPM 不链接对等依赖项

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

我的包 json 是:

 "devDependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "^3.0.0-alpha.8",
"autoprefixer": "^6.3.3",
"rxjs": "5.0.0-beta.6",
"selenium-standalone": "^5.1.0",
"style-loader": "^0.13.0",
"stylelint": "^6.3.2",
"stylelint-webpack-plugin": "^0.2.0",
"to-string-loader": "^1.1.3",
"ts-helpers": "^1.1.1",
"tslint": "^3.3.0",
"tslint-loader": "^2.1.0",
"typescript": "^1.8.10",
"typings": "^1.0.4",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-hot-middleware": "^2.9.1",
"webpack-split-by-path": "0.1.0",
"zone.js": "0.6.12"
}

当我执行 npm install 时,出现以下错误:

+-- UNMET PEER DEPENDENCY @angular/common@2.0.0-rc.4
+-- UNMET PEER DEPENDENCY @angular/compiler@2.0.0-rc.4
+-- UNMET PEER DEPENDENCY @angular/core@2.0.0-rc.4
+-- @angular/forms@0.2.0
+-- @angular/http@2.0.0-rc.4
+-- UNMET PEER DEPENDENCY @angular/platform-browser@2.0.0-rc.4
+-- UNMET PEER DEPENDENCY @angular/platform-browser-dynamic@2.0.0-rc.4
+-- @angular/router@3.0.0-rc.1

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 @angular/router@3.0.0-rc.1 requires a peer of @angular/core@^2.0.0-rc.5 but none was installed.
npm WARN @angular/router@3.0.0-rc.1 requires a peer of @angular/compiler@^2.0.0-rc.5 but none was installed.
npm WARN @angular/router@3.0.0-rc.1 requires a peer of @angular/common@^2.0.0-rc.5 but none was installed.
npm WARN @angular/router@3.0.0-rc.1 requires a peer of @angular/platform-browser@^2.0.0-rc.5 but none was installed.
npm WARN @angular/router@3.0.0-rc.1 requires a peer of @angular/platform-browser-dynamic@^2.0.0-rc.5 but none was installed.

如果我转到核心库并执行 npm list,我会得到以下信息:

node_modules/@angular/core$ npm list
@angular/core@2.0.0-rc.4
+-- UNMET PEER DEPENDENCY rxjs@5.0.0-beta.6
`-- UNMET PEER DEPENDENCY zone.js@^0.6.6

npm ERR! peer dep missing: rxjs@5.0.0-beta.6, required by @angular/core@2.0.0-rc.4
npm ERR! peer dep missing: zone.js@^0.6.6, required by @angular/core@2.0.0-rc.4

但是 rxjs@5.0.0-beta.6 和 zone.js@^0.6.6 已经按照 package.json 安装了。为什么 npm 不将这些库链接到所需的库?

最佳答案

您确定所有这些都是 devDependencies,而不是需要与应用程序一起部署的依赖项(例如 angular)吗?如果您在依赖项中也有这些 Angular 模块,那么对等 rxjs 和 zonejs 将需要在依赖项中。

关于angular - NPM 不链接对等依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39034470/

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