How to check and change the Nodejs version on Ubuntu?

Just type npm version in your command line and it will display all the version details about node, npm, v8 engine etc.


Open up the terminal and type node -v

To change your node version, I'd recommend installing nvm. Once installed, to switch versions it's as simple as

nvm use <version>

You can check your version by using this code (node -v) in linux terminal and If you want to upgrade it to stable version you can use following codes one by one.

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

You can check your current NodeJS version by using command node -v. And changing your version can be done by using node version manager. The easiest way to do that is by running this $ npm install -g n now you can change your current NodeJS version using n (version) e.g. n 4.0.0.

node -v
npm install -g n
n 4.0.0

Tags:

Ubuntu

Node.Js