2016-11-10 109 views
1

我正在嘗試使用.net和Angular2創建應用程序。無法爲angular2項目執行npm install

當我做NPM安裝我收到以下錯誤

NPM錯誤出現在很多行說NPM ERR! 如何創建成功全NPM的angular2應用程式安裝

package.json如下

 { 
     "name": "angular-quickstart", 
     "version": "1.0.0", 
     "scripts": { 
     "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", 
     "lite": "lite-server", 
     "tsc": "tsc", 
     "tsc:w": "tsc -w" 
     }, 
     "licenses": [ 
     { 
     "type": "MIT", 
     "url": "https://github.com/angular/angular.io/blob/master/LICENSE" 
     } 
     ], 
     "dependencies": { 
     "@angular/common": "~2.1.1", 
     "@angular/compiler": "~2.1.1", 
     "@angular/core": "~2.1.1", 
     "@angular/forms": "~2.1.1", 
     "@angular/http": "~2.1.1", 
     "@angular/platform-browser": "~2.1.1", 
     "@angular/platform-browser-dynamic": "~2.1.1", 
     "@angular/router": "~3.1.1", 
     "@angular/upgrade": "~2.1.1", 
     "angular-in-memory-web-api": "~0.1.13", 
     "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" 
     }, 
     "devDependencies": { 
     "@types/core-js": "^0.9.34", 
     "@types/node": "^6.0.45", 
     "concurrently": "^3.0.0", 
     "lite-server": "^2.2.2", 
     "typescript": "^2.0.3" 
     } 
     } 
+3

package.json不存在 –

+0

我之前在Angular2網站中添加了package.json。因爲它沒有工作,所以我刪除了node.js.Unable來立即安裝。一旦node.js重新安裝,我將更新。 –

+1

嘗試更新節點 - https://nodejs.org/en/ – Kapein

回答

0

檢查使用node -v和NPM使用節點js版npm -v

版本要求用於節點v4.xx或更高版本,對於NPM 的3.xx或更高

如果沒有的話,從Here

而對於NPM安裝最新嘗試的NodeJS

npm install [email protected] -g 

然後安裝在用的package.json列出的軟件包命令

npm install 
+0

我目前的版本是0.8.16.Seems是問題。我有安裝問題新版本的節點。一旦我修復,我會更新 –