一直试图在Webstorm中设置我的Angular2应用程序,并遇到了npm install的问题,因为'reflect-metadata@0.1.8'有一个未满足的对等依赖项,它失败了。我试图用
手动安装它 sudo npm install reflect-metadata@0.1.8
但它不起作用。这是尝试npm install时的终端输出:
sudo npm install
angular2-starter@1.0.0 /home/chase/angular2-starter
├── es6-promise@3.2.1 extraneous
└── UNMET PEER DEPENDENCY reflect-metadata@0.1.8
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 angular2@2.0.0-beta.17 requires a peer of reflect-metadata@0.1.2 but none was installed.
npm WARN angular2-starter@1.0.0 No description
npm WARN angular2-starter@1.0.0 No repository field.
这是我的Package.json文件:
{
"name": "angular2-starter",
"version": "1.0.0",
"scripts": {
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"license": "ISC",
"dependencies": {
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/forms": "0.3.0",
"@angular/http": "2.0.0-rc.5",
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.5",
"angular2": "^2.0.0-beta.17",
"angular2-in-memory-web-api": "0.0.15",
"bootstrap": "^3.3.6",
"core-js": "^2.4.0",
"es6-shim": "^0.35.1",
"reflect-metadata": "^0.1.2",
"rxjs": "^5.0.0-beta.6",
"systemjs": "0.19.27",
"zone.js": "^0.6.15"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^1.0.4"
}
}
任何想法?感谢
答案 0 :(得分:2)
npm WARN angular2@2.0.0-beta.17 requires a peer of reflect-metadata@0.1.2 but none was installed.
表示您需要正确的版本并且没有安装它。您可以通过更正package.json以在版本之前没有插入符号(^)来更改此操作。
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.6",
删除插入符将安装特定版本。但这会阻止安装更新版本。