How to check and change the Nodejs version on Ubuntu?

Posted on Dec 12, 2022

Question

I am using Ubuntu Linux.

How can I check current nodejs version? I guess, I have 6 version, but I am not sure.

And is there way to change it, because I need 4 version. Can some one give step by step commands?

Answer

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>