Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

v4 to v5 upgrade not working as instructed on angular-update-guide.firebaseapp.com

Tags:

angular

I'm attempting to upgrade several Angular 4 apps to Angular 5 using the upgrade instructions on https://angular-update-guide.firebaseapp.com. I've attempted it on 3 different Windows 10 systems, but they all fail.

Below is the type of error that I get. Although, it's not consistently about @angular/common every time. 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.

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' [email protected] 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. 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. Upgrading should be much easier/automated.

like image 686
Dan Rullo Avatar asked Nov 11 '17 14:11

Dan Rullo


1 Answers

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

I had typescript 2.6, so I rolled back (their instructions seem specific about the version, listing it twice)

npm install [email protected] --save-exact

Upgrade all angular components. This is same as the upgrade guide but @latest instead of the versions.

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

npm install rxjs@^5.5.2
like image 176
snomad Avatar answered Sep 22 '22 19:09

snomad