Need to update your version of Node.js? Here's how you can upgrade or downgrade from the command line using npm.
As you may know, Surreal CMS used to be a PHP app but last year I rebuilt it in Vue.js + Node.js. Being able to switch between Node versions quickly was really helpful while developing, so here are my notes for managing which version is currently installed.
Big news! 🎉
I just made Surreal CMS free for personal, educational, and non-profit websites. If you're looking for a new way to manage your static website, check it out and let me know what you think!
Determining your Node version
First off, let's figure out which version of Node is currently installed.
The version number displayed is the one that's currently active on your machine. Now, let's install a program called n that will let us easily switch between Node versions.
sudo npm install -g n
Upgrading to the latest stable version
Once n is installed, this simple command will update you to the latest stable version of Node.
sudo n stable
Changing to a specific version
If you need a specific version, simply specify the version number you want like this.
sudo n 10.16.0
As you can see, n is a really handy program that makes switching between Node versions effortless. It's worth keeping around if you do any serious development with Node.js.