So, I have Node.js installed and now when I tried to install Mongoosejs I got an error telling me that I don't have the needed version of Node.js (I have v0.4.11 and v0.4.12 is needed).
How can I upgrade to this version? I suppose I just could install it again with the latest version, but I don't want to do it before I'm sure that my project folders in the folder "node" won't be deleted.
Install npm =>
Install n =>
latest version of node =>
So latest version will be downloaded and installed
Specific version of node you can
List available node versions =>
Install a specific version =>
sudo npm install n -g sudo n 0.12.2
or
sudo npm install -g n sudo n latest
or
sudo npm cache clean -f sudo npm install -g n sudo n latest
These work well. But for
UX term
terminalnode -v
did not show latest version so I have closed and reopened new terminal. I foundv10.1.0
, output ofnode-v
after installation bysudo n latest
For Windows
I had the same problem, I tried to reinstall and didn't worked for me.
Remove
"C:\Program Files(x86)\nodejs"
from your system enviormentPATH
and thats it!I had node version v7.10.0 in Ubuntu
Used below commands to upgrade
Now its upgraded to v8.2.1
or
After install nvm as @nelsonic describes, this is the easiest way to keep it upgraded:
"node" is a shortcut to the last version, so you can install the last version with:
And to always use the "node" version:
Finally to upgrade your node version and keep the installed packages:
just run command line
npm install -g npm
orsudo npm install -g npm
to update it for mac user. That's it.