Update npm and node version in mac.
To update npm and node version in mac there are multiple options which you can refer from the below given url. This is the url from where I took help to update the npm version on my system- https://www.hostingadvice.com/how-to/update-node-js-latest-version/
I have Update Node Using a Package Manager.
First you can check the installed npm version by typing npm -v
in the terminal and node version: node -v
.
Now to download the latest version, use the below command:
sudo npm cache clean -fsudo npm install -g n latestsudo n stable
use `stable` to install the stable npm version. Now to update the node version type : `sudo n stable`.
After running this command check the updated version using the same above mentioned command. The version I installed was:-
mymac:~ rahul$ npm -v6.12.0mymac:~ rahul$ node -vv12.13.0
Thank you.