[英]v4 to v5 upgrade not working as instructed on angular-update-guide.firebaseapp.com
I'm attempting to upgrade several Angular 4 apps to Angular 5 using the upgrade instructions on https://angular-update-guide.firebaseapp.com . 我正在尝试使用https://angular-update-guide.firebaseapp.com上的升级说明将几个Angular 4应用升级到Angular 5。 I've attempted it on 3 different Windows 10 systems, but they all fail.
我在3个不同的Windows 10系统上尝试过它,但它们都失败了。
Below is the type of error that I get. 下面是我得到的错误类型。 Although, it's not consistently about @angular/common every time.
虽然,每次都不是@ angular / common。 It seems to randomly complain about different packages.
它似乎随机抱怨不同的包裹。 I can run the command 3 times in a row and it will say 'No matching version found' for 3 different packages.
我可以连续运行3次命令,它会为3个不同的包说“找不到匹配的版本”。
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @angular/common@'5.0.0'
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
The command being run is: 正在运行的命令是:
npm install @angular/animations@'^5.0.0' @angular/common@'^5.0.0' @angular/compiler@'^5.0.0' @angular/compiler-cli@'^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/platform-server@'^5.0.0' @angular/router@'^5.0.0' typescript@2.4.2 rxjs@'^5.5.2'
Keeping up with the frequent changes to Angular and upgrading apps to current versions has been an ongoing struggle that I think needs some attention. 跟上Angular的频繁更改并将应用程序升级到当前版本一直是一场持续的斗争,我认为需要一些关注。 In most cases, I've had to perform extensive manual editing to package.json and package-lock.json, or I've simply started the project over from scratch and imported my code.
在大多数情况下,我必须对package.json和package-lock.json进行大量的手动编辑,或者我只是从头开始创建项目并导入我的代码。 Upgrading should be much easier/automated.
升级应该更容易/自动化。
Had the same issue and fixed it with 3 installs, though I think it may have just been the single quotes around the version number 有同样的问题,并修复了3个安装,但我认为它可能只是版本号周围的单引号
I had typescript 2.6, so I rolled back (their instructions seem specific about the version, listing it twice) 我有打字稿2.6,所以我回滚(他们的说明似乎具体的版本,列出两次)
npm install typescript@2.4.2 --save-exact
Upgrade all angular components. 升级所有角度组件。 This is same as the upgrade guide but @latest instead of the versions.
这与升级指南相同,但@latest而不是版本。
npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest
Finally installed rxjs last 最后安装了rxjs
npm install rxjs@^5.5.2
Removing the quotes around the version numbers did it for me. 删除版本号周围的引号为我做了。
Alternatively, you can try the approach below as mentioned here . 或者,你可以尝试为下面提到的方法在这里 。
$ npm install @angular/{animations,common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router}@5.0.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.