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.
n makes version-management easy:
sudo npm install n -g
For the latest stable version:
sudo n stable
For the latest version:
sudo n latest
just reinstall node from the .msi in Windows from the node website.
The current stable "LTS" version of node is 10.16.0 (2019-07-12) see: nodejs.org for latest.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Once you've got NVM you can install a specific version of Node.js using the nvm command:
nvm install v10.16
Note: you may need to close & re-open your terminal window for
nvm command to be available.
You should expect to see something like this in your terminal:
Now using node v10.16.0
Yes, it's that easy and didn't require
Now please Upvote this (so others can avoid
and have a lovely day writing node.js code!
Microsoft Windows User? Use: https://github.com/coreybutler/nvm-windows
Review of the node mailing list indicates that using NVM (Node Version Manager) is the preferred way to manage your nodejs versioning/upgrading. see: github.com/nvm-sh/nvm
NVM is considered "better" than N because the verbose commands mean is much easier to keep track of what you are doing in your Terminal/SSH Log. Its also faster, saves kittens by not requiring
sudo and is used by the team at NPM the node.js security experts!