更新Angular 5 [英] Update to Angular 5

查看:65
本文介绍了更新Angular 5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更新Angular 5?
这是来自我的package.json:

How to update to Angular 5? This is from my package.json:

"dependencies": {
    "@angular/animations": "5.0.0",
    "@angular/common": "5.0.0",
    "@angular/compiler": "5.0.0",
    "@angular/core": "5.0.0",
    "@angular/forms": "5.0.0",
    "@angular/http": "5.0.0",
    "@angular/platform-browser": "5.0.0",
    "@angular/platform-browser-dynamic": "5.0.0",
    "@angular/router": "5.0.0",
    "@types/jwt-decode": "^2.2.1",
    "bootstrap": "^3.3.7",
    "bootstrap-sass": "^3.3.7",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.4.1",
    "intl": "^1.2.5",
    "jquery": "^3.2.1",
    "jwt-decode": "^2.2.0",
    "rxjs": "^5.4.2",
    "zone.js": "^0.8.14"
},
"devDependencies": {
    "@angular/cli": "1.4.0-rc.2",
    "@angular/compiler-cli": "5.0.0",
    "@angular/language-service": "5.0.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "angular-ide": "^0.9.31",
    "codelyzer": "~3.1.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "node-sass": "^4.5.3",
    "protractor": "~5.1.2",
    "raw-loader": "^0.5.1",
    "sass-loader": "^6.0.6",
    "sw-precache": "^5.2.0",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "~2.3.3"
}

当我运行npm install时出现此错误


npm ERR! Windows_NT 6.1.7601 npm ERR! argvC:\Program
Files \\\
odejs\\\
ode.exeC:\Program
Files \\\
odejs \\\
ode_modules \ npm \ bin \ nnpm-cli。 js安装npm ERR!
node v6.11.2 npm ERR! npm v3.10.10 npm ERR!代码ETARGET

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v6.11.2 npm ERR! npm v3.10.10 npm ERR! code ETARGET

npm ERR! notarget未找到兼容的版本:@ angular / common @ 5.0.0
npm ERR! notarget有效安装目标:npm ERR! notarget 5.0.0-rc.0,
5.0.0-beta.7,5.0.0-beta.6,5.0.0-beta.5,5.0.0-beta.4,5.0.0-beta .3,5.0.0-beta.2,5.0.0-beta.1,5.0.0-beta.0,4.4.4,4.4.3,4.4.2,
4.4.1,4.4.0 -RC.0,4.3.6,4.3.5,4.3.4,4.3.3,4.3.2,4.3.1,4.3.0,4.3.0-rc.0,4.3.0-beta.1,4.3 .0-beta.0,4.2.6,4.2.5,4.2.4,4.2.3,4.2.2,4.2.1,4.2.0,4.2。 0-rc.2,4.2.0-rc.1,4.2.0-rc.0,4.2.0-beta.1,4.2.0-beta.0,4.1.3,4.1.2,4.1.1, 4.1.0,4.1.0-rc.0,4.1.0-beta.1,4.1.0-beta.0,4.0.3,4.0.2,4.0.1,4.0.0,4.0.0-rc。 6,4.0.0-rc.5,4.0.0-rc.4,4.0.0-rc.3,4.0.0-rc.2,4.0.0-rc.1,4.0.0-rc.0, 4.0.0-beta.8,4.0.0-beta.7,4.0.0-beta.6,4.0.0-beta.5,4.0.0-beta.4,4.0.0-beta.3,
4.0.0-beta.2,4.0.0-beta.1,4.0.0-beta.0,2.4.10,2.4.9,2.4.8,2.4.7,2.4.6,2.4.5, 2.4.4,2.4.3,2.4.2,2.4.1,2.4.0,2.3.1,2.3.0,2.3.0-rc.0,2.3.0-beta.1,2。
3.0-beta.0,2.2.4,2.2.3,2.2.2,2.2.1,2.2.0,2.2.0-rc.0,2.2.0-beta.1,2.2.0-beta.0, 2.1.2,2.1.1,2.1.0,2.1.0-rc.0,2.1.0-beta.0,2.0.2,2.0.1,2.0.0,2.0.0-r c.7,2.0 .0-rc.6,2.0.0-rc.5,2.0.0-rc.4,2.0.0-rc.3,2.0.0-rc.2,2.0.0-rc.1,2.0.0 -rc.0,0.0.0-7,0.0.0-6,0.0.0-5,0.0.0-4,0.0.0-3,0.0.0-2,0.0.0-1,0.0.0 -0 npm ERR! notarget npm ERR! notarget这很可能不是npm本身的问题。错误的ERR! notarget在大多数情况下,你或你的一个依赖项
请求npm ERR!不要存在不存在的
包版本。错误的ERR! notarget npm ERR!
notarget它被指定为'gizza'npm ERR的依赖项! notarget

npm ERR! notarget No compatible version found: @angular/common@5.0.0 npm ERR! notarget Valid install targets: npm ERR! notarget 5.0.0-rc.0, 5.0.0-beta.7, 5.0.0-beta.6, 5.0.0-beta.5, 5.0.0-beta.4, 5.0.0-beta.3, 5.0.0-beta.2, 5.0.0-beta.1, 5.0.0-beta.0, 4.4.4, 4.4.3, 4.4.2, 4.4.1, 4.4.0-RC.0, 4.3.6, 4.3.5, 4.3.4, 4.3.3, 4.3.2, 4.3.1, 4.3.0, 4.3.0-rc.0, 4.3.0-beta.1, 4.3.0-beta.0, 4.2.6, 4.2.5, 4.2.4, 4.2.3, 4.2.2, 4.2.1, 4.2.0, 4.2. 0-rc.2, 4.2.0-rc.1, 4.2.0-rc.0, 4.2.0-beta.1, 4.2.0-beta.0, 4.1.3, 4.1.2, 4.1.1, 4.1.0, 4.1.0-rc.0, 4.1.0-beta.1, 4.1.0-beta.0, 4.0.3, 4.0.2, 4.0.1, 4.0.0, 4.0.0- rc.6, 4.0.0-rc.5, 4.0.0-rc.4, 4.0.0-rc.3, 4.0.0-rc.2, 4.0.0-rc.1, 4.0.0-rc.0, 4.0.0-beta.8, 4.0.0-beta.7, 4.0.0-beta.6, 4.0.0-beta.5, 4.0.0-beta.4, 4.0.0-beta.3, 4.0.0-beta.2, 4.0.0-beta.1, 4.0.0-beta.0, 2.4.10, 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.3.1, 2.3.0, 2.3.0-rc.0, 2.3.0-beta.1, 2. 3.0-beta.0, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.2.0-rc.0, 2.2.0-beta.1, 2.2.0-beta.0, 2.1.2, 2.1.1, 2.1.0, 2.1.0-rc.0, 2.1.0-beta.0, 2.0.2, 2.0.1, 2.0.0, 2.0.0-r c.7, 2.0.0-rc.6, 2.0.0-rc.5, 2.0.0-rc.4, 2.0.0-rc.3, 2.0.0-rc.2, 2.0.0-rc.1, 2.0.0-rc.0, 0.0.0-7, 0.0.0-6, 0.0.0-5, 0.0.0-4, 0.0.0-3, 0.0.0-2, 0.0.0-1, 0.0.0-0 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. npm ERR! notarget npm ERR! notarget It was specified as a dependency of 'gizza' npm ERR! notarget

我知道Angular 5仍处于测试阶段,但我想测试它。

编辑:版本5.0.0现已存在,截至2017年11月1日

EDIT: Version 5.0.0 now does exist as of Nov. 1st 2017

推荐答案

编辑:版本5.0.0现在确实存在截至2017年11月1日

NPM告诉你5.0 .0不存在。将package.json更改为5.0.0-rc.0之类的建议候选版本之一。很有可能它们并非都是如此,所以读取npm错误它在这种情况下实际上是有用的。

NPM is telling you 5.0.0 doesnt exist. change your package.json to one of the suggested release candidates like 5.0.0-rc.0. There is a good chance they aren't all exactly that either so read the npm error it is actually helpful in this case.

"dependencies": {
    "@angular/animations": "5.0.0-rc.0",
    "@angular/common": "5.0.0-rc.0",
    "@angular/compiler": "5.0.0-rc.0",
    "@angular/core": "5.0.0-rc.0",
    "@angular/forms": "5.0.0-rc.0",
    "@angular/http": "5.0.0-rc.0",
    "@angular/platform-browser": "5.0.0-rc.0",
    "@angular/platform-browser-dynamic": "5.0.0-rc.0",
    "@angular/router": "5.0.0-rc.0",
    "@types/jwt-decode": "^2.2.1",
    "bootstrap": "^3.3.7",
    "bootstrap-sass": "^3.3.7",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.4.1",
    "intl": "^1.2.5",
    "jquery": "^3.2.1",
    "jwt-decode": "^2.2.0",
    "rxjs": "^5.4.2",
    "zone.js": "^0.8.14"
},
"devDependencies": {
    "@angular/cli": "1.4.0-rc.2",
    "@angular/compiler-cli": "5.0.0",
    "@angular/language-service": "5.0.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "angular-ide": "^0.9.31",
    "codelyzer": "~3.1.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "node-sass": "^4.5.3",
    "protractor": "~5.1.2",
    "raw-loader": "^0.5.1",
    "sass-loader": "^6.0.6",
    "sw-precache": "^5.2.0",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "~2.3.3"
}

这篇关于更新Angular 5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆