Reputation: 2342
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?
Upvotes: 54
Views: 221954
Reputation: 31
To change your node version, I'd recommend installing nvm
. Once installed, switch versions follow the instruction below;
nvm use <any specified version you prefer "example v16.0.0">
Example:
nvm alias default 16
This will enforce as the current default version.
Upvotes: 3
Reputation: 1049
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
Upvotes: 12
Reputation: 7373
Just type npm version
in your command line and it will display all the version details about node, npm, v8 engine etc.
Upvotes: 2
Reputation: 82136
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>
Upvotes: 83
Reputation: 1754
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
Upvotes: 26