I just installed Node.js and npm (for additional modules).
How can I update Node.js and the modules which I\'m using to the latest versions
I think the best way to manage node.js is to use NVM. NVM stands for Node Version Manager.
It's a must-have tool for node.js developers!
You can install NVM using the following command, open terminal and run any one of the following:-
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
or
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
After installing this it's recommended to close the current terminal and open a new one since NVM will be adding some environment variables so terminal needs to be restarted.
I'll list down some of the basic commands for using NVM.
nvm ls-remote
nvm install v10.15.1
nvm ls
nvm uninstall v10.15.1
npm on the current node versionnvm install-latest-npm
npm packages from one version to another instead of manually installing each one of them!