简体   繁体   English

v4到v5升级无法按照angular-update-guide.firebaseapp.com上的说明进行操作

[英]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.

相关问题 想要将项目从 Angular v5 升级到 Angular v6 - Want to upgrade project from Angular v5 to Angular v6 角度版本升级出现 404 错误(v5 到 v6) - angular version upgrade giving 404 error (v5 to v6) Angular 从 v4 升级到 v5 后,无法从“@angular/common/http”导入“httpclient” - Can’t import ‘httpclient’ from ‘@angular/common/http’ after Angular upgraded from v4 to v5 带有角度定制管道的ionic v4无法正常工作 - ionic v4 with angular custom pipe not working 如何在D3js v4和Angular 4中实现FontAwesome v5图标 - How can to implement FontAwesome v5 icons in D3js v4 and Angular 4 如何在使用 Angular 8 的 Facebook SDK V4 或 V5 登录时获取用户验证状态(蓝色徽章)? - How to get user verification status (Blue badge) while logging in with Facebook SDK V4 or V5 in angular 8? Ionic v5 到 v6 更新失败? - Ionic v5 to v6 update failed? Bootstrap v4工具提示(系链)不起作用(Angular2) - Bootstrap v4 tooltip (tether) isn't working (angular2) D3.js V4 Zoom在Angular中不起作用 - D3.js V4 Zoom not working in Angular Angular v5使用共享数据抛出ExpressionChangedAfterItHasBeenCheckedError - Angular v5 throws an ExpressionChangedAfterItHasBeenCheckedError with shared data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM