0

每当我尝试 sudo npm install 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

包.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"
  }
}

打字.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"
  }
}
4

1 回答 1

0

我能够使用下面链接的线程解决此问题

Angular2 QuickStart npm start 无法正常工作

"将 package.json "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" "更改为 "start": "concurrently \"npm run tsc:w\" \"npm运行精简版\" ",为我工作"

于 2016-07-09T22:51:06.470 回答