2016-01-11 83 views
1

我一起在角2. TUTS +教程在此視頻中以下內容:https://code.tutsplus.com/courses/whats-new-in-angular-2/lessons/angular-2-and-es5筆者說,鍵入以下命令:錯誤angular2 --save

npm install angular2 --save

我試着那,以及在它的前面使用sudo爲好,但得到以下錯誤:

npm WARN package.json [email protected] No description 
npm WARN package.json [email protected] No repository field. 
npm WARN package.json [email protected] No README data 
npm ERR! Darwin 15.0.0 
npm ERR! argv "node" "/usr/local/bin/npm" "install" "angular2" "--save" 
npm ERR! node v0.12.7 
npm ERR! npm v2.11.3 
npm ERR! code ETARGET 

npm ERR! notarget No compatible version found: [email protected]'*' 
npm ERR! notarget Valid install targets: 
npm ERR! notarget ["2.0.0-alpha.8.dev","2.0.0-alpha.8.prod","2.0.0-alpha.11","2.0.0-alpha.12","2.0.0-alpha.13","2.0.0-alpha.14","2.0.0-alpha.15","2.0.0-alpha.16","2.0.0-alpha.17","2.0.0-alpha.18","2.0.0-alpha.19","2.0.0-alpha.20","2.0.0-alpha.21","2.0.0-alpha.22","2.0.0-alpha.23","2.0.0-alpha.24","2.0.0-alpha.25","2.0.0-alpha.26","2.0.0-alpha.27","2.0.0-alpha.28","2.0.0-alpha.29","2.0.0-alpha.30","2.0.0-alpha.31","2.0.0-alpha.32","2.0.0-alpha.33","2.0.0-alpha.34","2.0.0-alpha.35","2.0.0-alpha.36","2.0.0-alpha.37","2.0.0-alpha.38","2.0.0-alpha.39","2.0.0-alpha.40","2.0.0-alpha.41","2.0.0-alpha.42","2.0.0-alpha.44","2.0.0-alpha.45","2.0.0-alpha.46","2.0.0-alpha.47","2.0.0-alpha.48","2.0.0-alpha.49","2.0.0-alpha.50","2.0.0-alpha.51","2.0.0-alpha.52","2.0.0-alpha.53","2.0.0-alpha.54","2.0.0-alpha.55","2.0.0-beta.0","2.0.0-beta.1"] 
npm ERR! notarget 
npm ERR! notarget This is most likely not a problem with npm itself. 
npm ERR! notarget In most cases you or one of your dependencies are requesting 
npm ERR! notarget a package version that doesn't exist. 

enter image description here

想法?

作者是能夠做到這一點罰款沒有錯誤:

enter image description here

+2

您可以執行'npm install angular2 @ SPECIFIC_VERSION'其中* SPECIFIC_VERSION *是錯誤中顯示的內容之一,或者使用'npm install angular2 @ latest --save' –

+0

謝謝!就是這樣:D'@ latest'想發佈你的答案? –

回答

4

安裝angular2使用NPM您可以指定版本或使用@latest

  • 指定版本
npm install [email protected] --save 
  • 使用latest(這顯然會安裝在故宮提供的最新版本)
npm install [email protected] --save 

還要注意,有計劃地支持[email protected]將添加posibility安裝夜間構建,但尚未支持(到目前爲止,快照是不時發佈的,但該命令尚不可用)。查詢issue #4671瞭解更多信息。