gpt4 book ai didi

angular - 在 npm 中安装新依赖项时 RXJS 版本不匹配

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

rxjs@5.0.0-beta.12rxjs@5.0.0-beta.6 版本经常出现问题。当我尝试安装新的 npm 库时,控制台向我显示此错误:

MacBook:angular2-seed$ npm install less
angular2-quickstart@1.0.0 /Volumes/Data/Proyectos/Paytime/angular2-seed
├─┬ less@2.7.1
│ ├─┬ errno@0.1.4
│ │ └── prr@0.0.0
│ ├── image-size@0.5.0
│ ├── mime@1.3.4
│ ├─┬ mkdirp@0.5.1
│ │ └── minimist@0.0.8
│ ├─┬ promise@7.1.1
│ │ └── asap@2.0.5
│ └── source-map@0.5.6
└── UNMET PEER DEPENDENCY rxjs@5.0.0-beta.6

npm WARN @angular/core@2.0.1 requires a peer of rxjs@5.0.0-beta.12 but none was installed.
npm WARN angular2-quickstart@1.0.0 No description
npm WARN angular2-quickstart@1.0.0 No repository field.

然后,如果我更改 rxjs 的版本,我会得到另一个错误:

MacBook:angular2-seed$ npm install

> angular2-quickstart@1.0.0 postinstall /Volumes/Data/Proyectos/Paytime/angular2-seed
> typings install


└── es6-shim (ambient)

angular2-quickstart@1.0.0 /Volumes/Data/Proyectos/Paytime/angular2-seed
└─┬ UNMET PEER DEPENDENCY rxjs@5.0.0-beta.12
└── symbol-observable@1.0.2

npm WARN angular2@2.0.0-beta.17 requires a peer of rxjs@5.0.0-beta.6 but none was installed.
npm WARN angular2-quickstart@1.0.0 No description
npm WARN angular2-quickstart@1.0.0 No repository field.
npm ERR! code 1
MacBook:angular2-seed$

我在一个连续的循环中,我不知道如何解决它,你能帮我吗?

我的 package.json 内容是:

{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
},
"license": "ISC",
"dependencies": {
"@angular/common": "2.0.1",
"@angular/compiler": "2.0.1",
"@angular/core": "2.0.1",
"@angular/forms": "2.0.1",
"@angular/platform-browser": "2.0.1",
"angular2": "2.0.0-beta.17",
"es6-promise": "^3.0.2",
"es6-shim": "^0.35.0",
"ng2-bootstrap": "^1.1.1",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.12",
"systemjs": "0.19.22",
"zone.js": "0.6.21"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"typescript": "^2.0.2",
"typings": "^0.8.1"
}
}

最佳答案

从您的依赖项中删除"angular2": "2.0.0-beta.17"。那已经完全过时了,不再使用了。

Angular 2.0.x 基础依赖如下:

  "dependencies": {
"@angular/common": "~2.0.2",
"@angular/compiler": "~2.0.2",
"@angular/core": "~2.0.2",
"@angular/forms": "~2.0.2",
"@angular/http": "~2.0.2",
"@angular/platform-browser": "~2.0.2",
"@angular/platform-browser-dynamic": "~2.0.2",
"@angular/router": "~3.0.2",
"@angular/upgrade": "~2.0.2",
"angular-in-memory-web-api": "~0.1.5",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.8",
"rxjs": "5.0.0-beta.12",
"systemjs": "0.19.39",
"zone.js": "^0.6.25"
},

引用:https://angular.io/guide/quickstart

如果您正在关注 Angular 2 快速入门示例,您可以从 github 存储库再次克隆它:https://github.com/angular/quickstart

关于angular - 在 npm 中安装新依赖项时 RXJS 版本不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39926873/

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