Need directions on updating packages

I’m fairly new in node/cordova/angular/ionic etc… I build my first app for android and released as a closed beta and collected a couple of problems. I found some of the problems are caused by bugs in native code etc.

I use Genymotion, VS Code and every possible helper plugin, also on device executions.

During this course I had to update, remove all packages, re-build all, etc. and it got worse. Now I even cannot build a stable release…

My question is NOT related to a specific bug. I rather want to know how you guys/gals manage it. I had a fixation in upgrading all software continuously, but I see that cannot be the case here.

This is what I do and what I want to know:

  1. Check Android Studio and update. If needed check the environment variables (paths etc) also.

  2. I check and see what is the latest supported packages and fix those versions in the package.json file and update.
    Question: This changelog is updated rather slow, e.g. @angular/* packages are now at 5.1.3 but the changelog states 5.0.0. Can I upgrade these and when?

  3. I upgrade node.js from time to time, but keep multiple copies with nvm-windows utility.
    Question: Is it safe to use the latest stable node.js in ionic development?

  4. I use “npm outdated -g” and/or “npm-check-updates -g” utility and I do upgrade (except typescript).
    Question: Is this safe?

  5. I use “npm outdated” and/or “npm-check-updates” utility for local packages and I do upgrade all-not-version-fixed packages.
    Question: Is this safe?

  6. I use “cordova-check-plugins” utility for local cordova plugin packages and I do upgrade all packages.
    Question: Is this safe?

  7. If anything is messed-up, I cleanup and rebuild.
    Delete node_modules, platforms, plugins and www directories and rebuild everything with:

  • npm install --save --no-optional
  • ionic cordova prepare

Sometimes I use:

  • remove/add android platform
  • remove/add cordova plugins + reinstall @ionic-native packages latest versions
    I wrote a batch file for this and I keep it updated for a specific project…
    Question: Do you frequently use this or am I lost?
  1. If I’m totally lost I remove everything and rebuild the development environment from scratch (node, npm, npm caches etc - I did this 3 or 4 times in the last 2-3 months with this project).
    Question: Do you ever need to do this?

A feature may work in one (older) cordova-android but another feature needs a later one…

I’m lost in github’s open issues, closed issues, re-opened issues, changelogs etc. This is a simple app after all and ionic development supposed to be easy, isn’t it?

As you can see I’m totally frustrated and confused… There must be an easier and more solid way.

Please share your knowledge on “never do”, “must do”, “should do” and "can do"s in package version management.

I think many novices hit these walls…

Thanks in advance…

I don’t think this is a good idea in general. You end up with too many updates to keep track of. It’s probably better to become good friends with the command line.

1 Like

I recommended this for a long time, but recently uninstalled it myself, because of its inability to play well with npm 5.6. So be aware of this issue. The nvm-windows creator has said he may not fix it, and is actively requesting assistance. I’m listening to that issue thread, but it probably won’t be resolved anytime soon.

1 Like

Unless you did something Really Dumb ™, all you need to do is to physically put the node_modules folder in the recycling bin, and run npm cache clean --force.

1 Like

Thank you very much for your input Aaron, I really appreciate it.

A dumb (novice) programmer would never know if he/she did the Really Dumb ™ thing :blush:

My other questions are still valid thou. At the current state I’m in the common mood: “If it works, don’t touch it” :stuck_out_tongue:.

I personally don’t update angular except for the minor version revisions until the new angular is supported by ionic. I’m not sure what the official team stance is on this, but so far I haven’t run into any angular problems. So if ionic supports angular 5.0.0, it’s probably save to update to 5.0.X (right now I’m using 5.0.5).

I recommend sticking to the LTS version of node and just basically ignoring updates until the new LTS rolls around. It seems like you’re spending a lot of time on maintenance

I don’t run these commands, i just manually update my package.json whenever ionic has an update and nuke my node modules and re-run npm install. It’s definitely smart to keep typescript locked into whatever version ionic recommends.

It’s never been an issue for me to update cordova plugins - so you should probably just do this whenever you update the rest of your package.json. Most of these plugins don’t get updated too often so every month or two when ionic releases a new version should be fine.

Overall it’s good to just keep up with your development and only worry about package updates every once in a while. Usually when there’s a big change like the iPhone X requiring support for the notch, you’ll see a bunch of updates and it’s good to update.

Thank you Evan, this is exactly what I needed to know :smiley: