我在OS X(El Capitan)上安装了节点v4.4.0和npm v2.14.20。
我正在按照Angular 2官方网站上提供的5 Min Quickstart - ts页面上描述的步骤进行操作。
但是,当我执行npm install
时,我遇到了以下错误。
npm ERR! peerinvalid The package es6-shim@0.35.0 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer angular2@2.0.0-beta.9 wants es6-shim@^0.33.3
为了能够隔离问题,这就是我所做的。
npm init
空值,以生成空package.json
。我已将以下依赖项添加到package.json。
"dependencies": {
"angular2": "2.0.0-beta.9",
"es6-shim": "^0.35.0"
}
我执行了npm install
并观察到上述相同的错误。
这是peerDependencies
package.json
内的/node_modules/angular2
"peerDependencies": {
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.5.15"
}
考虑到es6-shim对等依赖的^0.33.3
版本要求,不应该使用版本0.35.0
安装es6-shim吗?我看不出的问题是什么?
答案 0 :(得分:7)
我有同样的问题,除了我有Windows10。 我通过将我的Node.js从4.4.1 LTS升级到5.9.0稳定来解决它。
答案 1 :(得分:3)
试试这个版本的package.json
,应该这样做
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.9",
"systemjs": "0.19.24",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.5.15"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"typescript": "^1.8.7",
"typings":"^0.7.5"
}
}
答案 2 :(得分:0)
的package.json
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.10",
"systemjs": "0.19.24",
"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"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"typescript": "^1.8.7",
"typings":"^0.7.5",
"grunt" : "^0.4.5",
"grunt-contrib-clean" : "^1.0.0",
"grunt-contrib-concat" : "^1.0.0",
"grunt-contrib-sass" : "^0.9.2",
"grunt-contrib-watch" : "^0.6.1"
}
}
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"
},
不确定我上面所做的一切是否完全正确。 但它到目前为止工作
我认为最近的更新(https://github.com/angular/quickstart/blob/master/package.json)导致了这个问题。
编辑:基本上改变是: