In this article, I am going to share how how to update node version on mac using terminal
After a long search on internet, I found partial solutions. May be they have worked for them. But they didn’t work for me.
I am going to explain you what I have done to upgrade my node versions.
Update Node Version On Mac Using Terminal
So, I was running v15.14.0 and I want to upgrade my node version to v16.15.0 which is a stable version as per the date I am writing this article.
The primary solution I found is,
1. Cleaning the NPM cache
sudo npm cache clean -f
2. Installing node
sudo npm install -g n
3. Install stable version of node
sudo n stable
That’s it. Node version is updated in your machine. BUT, It didn’t work on my machine.
Someone told to reboot the terminal or machine to see the updated version. But, it didn’t work either.
Then, I searched for other solutions and I found one. NVM is already installed in my machine. So, when I run,
nvm install v16.15.0
Boom! Node version updated on my machine.
I am sharing this here because, I have struggled a lot to do the same process before as well. This is going to help me as reference in future. There might be developers like me who might have facing issues.
This article may help them.