无法更新到Angular2 RC @ angular @ 2.0.0-rc.1

时间:2016-05-30 06:37:12

标签: npm angular

当我尝试将angular2升级为RC时,我收到以下错误。 JWT依赖于RC,所以我不得不更新到@angular

M:\workspace\Angular2StartKit>npm install
npm ERR! addLocal Could not install M:\workspace\Angular2StartKit\@angular@2.0.0-rc.1
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\manish\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.2.2
npm ERR! npm  v3.9.5
npm ERR! path M:\workspace\Angular2StartKit\@angular@2.0.0-rc.1
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open 'M:\workspace\Angular2StartKit\@angular@2.0.0-rc.1'
npm ERR! enoent ENOENT: no such file or directory, open 'M:\workspace\Angular2StartKit\@angular@2.0.0-rc.1'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! M:\workspace\Angular2StartKit\npm-debug.log    

的package.json

"dependencies": {  
    "angular2": "2.0.0-beta.1",  
    "angular2-jwt": "^0.1.12",  
    "body-parser": "~1.13.2",  
    "cors": "^2.7.1",  
    "es6-promise": "3.0.2",  
    "es6-shim": "0.33.3",  
    "express": "4.13.3",  
    "express-jwt": "^3.4.0",  
    "gulp-concat": "2.6.0",  
    "material-design-lite": "^1.1.3",  
    "mongodb": "^2.1.16",  
    "mongoose": "^4.4.12",  
    "promise": "^7.1.1",  
    "reflect-metadata": "0.1.2",  
    "rxjs": "5.0.0-beta.0",  
    "systemjs": "0.19.16",  
    "zone.js": "0.5.10"  
    }`      

1 个答案:

答案 0 :(得分:1)

在Angular2 RC1中,您需要在package.json文件中指定一组子包,而不是像Beta版本那样的大包:

{
  (...)
  "dependencies": {
    "@angular/common": "2.0.0-rc.1",
    "@angular/compiler": "2.0.0-rc.1",
    "@angular/core": "2.0.0-rc.1",
    "@angular/http": "2.0.0-rc.1",
    "@angular/platform-browser": "2.0.0-rc.1",
    "@angular/platform-browser-dynamic": "2.0.0-rc.1",
    "@angular/router": "2.0.0-rc.1",
    "@angular/router-deprecated": "2.0.0-rc.1",
    "@angular/upgrade": "2.0.0-rc.1",
    (...)
  }
}