[ionic4beta7] how to update an existing project to beta 11?

I’m trying to figure out how to update a project I’m working on to the latest beta.

I tried changing the package name in package.json to beta14 but then after redoing npm i I ended up with a bunch of errors like this:

npm WARN @ionic/ng-toolkit@1.0.8 requires a peer of @angular-devkit/architect@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/ng-toolkit@1.0.8 requires a peer of @angular-devkit/build-angular@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/ng-toolkit@1.0.8 requires a peer of @angular-devkit/core@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/ng-toolkit@1.0.8 requires a peer of @angular-devkit/schematics@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/schematics-angular@1.0.6 requires a peer of @angular-devkit/core@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic/schematics-angular@1.0.6 requires a peer of @angular-devkit/schematics@~0.8.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1140 packages from 1357 contributors and audited 50110 packages in 201.185s
found 0 vulnerabilities

and when I do npm outdated its listing a ton of packages.

It feels like trying to rip the whole thing to shreds by retyping the entire package.json with its latest versions for everything is not the way to do this.

Can anyone help me out with what I’m supposed to do, please?

I did some searches but the best I came up with was a similar question for Ionic 1 beta and that said get the new packages from a freshly scaffolded demo but thats still generating beta7 packages when I tried that.

Please have a look at the following post and check out the solution from @reedrichards

I followed the second way:

rm -r node_modules
rm package-lock.json
npm install

and it worked for me. I now also use ncu as recommended to update my package.json
Please also note that you should keep typescript 2.9.2 as recommended.

I only had to change the native dependencies to “beta.14” in Ionic beta 7. Now they are …beta.21.

I’m sorry @magetto but that is not a good way to update ionic.

The only thing you have to do is open package.json and edit the version number of @ionic/angular
Example: replace4.0.0-beta.7 with 4.0.0-beta.12
Save the file and run npm install.

This will install the beta.12 version of ionic.

@MattE just to be clear, in my post I suggest first to go with “npm rm/install @ionic/angular --save” and only if it doesn’t work to go with a full clean new install

…agreed for most (regular) cases. But when I did my last beta update this way I ran into dependency issues and I could resolve them by following the second solution. The discussed cons for the second solution were acceptable for me as I really wanted to keep my dependencies clean. From your point of view: are there additional cons not to do it this way?

Just to draw a conclusion to this, I have come back to Ionic development again today and successfully updated the project.

These console commands updated me to beta.13:

npm uninstall @ionic/angular
npm install @ionic/angular --save

Thanks for your help everyone.

2 Likes