每当我尝试sudo npm安装时,Angular 2模块都会更新并安装正常但是当打字安装尝试运行时我得到以下内容
angular2-in-memory-web-api@0.0.12 requires a peer of @angular/core@2.0.0-rc.2 but none was installed.
npm WARN angular2-in-memory-web-api@0.0.12 requires a peer of @angular/http@2.0.0-rc.2 but none was installed.
npm WARN an2_routes@1.0.0 No description
npm WARN an2_routes@1.0.0 No repository field.
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.4.5
npm ERR! npm v3.10.4
npm ERR! code ELIFECYCLE
npm ERR! an2_routes@1.0.0 postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the an2_routes@1.0.0 postinstall script 'typings install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the an2_routes package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs an2_routes
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls an2_routes
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/matthewatwell/Development/webDev/An2_routes/npm-debug.log
我已使用提升的权限全局安装了npm和typings
的package.json
{
"name": "an2_routes",
"version": "1.0.0",
"scripts": {
"start": "tsc && 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.3",
"@angular/compiler": "2.0.0-rc.3",
"@angular/core": "2.0.0-rc.3",
"@angular/forms": "0.1.1",
"@angular/http": "2.0.0-rc.3",
"@angular/platform-browser": "2.0.0-rc.3",
"@angular/platform-browser-dynamic": "2.0.0-rc.3",
"@angular/router": "3.0.0-alpha.7",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.3",
"systemjs": "0.19.27",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"angular2-in-memory-web-api": "0.0.12",
"bootstrap": "^3.3.6"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings":"^1.0.4"
}
}
typings.json
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160602141332",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160621231320"
}
}
答案 0 :(得分:0)
我能够使用下面链接的线程解决此问题
Angular2 QuickStart npm start is not working correctly
"更改package.json"开始":" tsc&&同时\ n" npm run tsc:w \" \" npm run lite \" ",到"开始":"同时\" npm运行tsc:w \" \" npm run lite \" ",为我工作"