Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NVM: How do you set the node version globally?

When using Node Version Manager, I can set the version of node to the latest version in the current directory with nvm use node. How do you specify which version to use?

like image 366
sdfsdf Avatar asked Dec 11 '22 10:12

sdfsdf


1 Answers

Let's say you have versions v8.2.0 and v8.3.0 installed.

To make version v8.2.0 the currently used one, you can call nvm use 8.2.0.

nvm use also accepts aliases, so you could create one like this: nvm alias mysuperversion 8.2.0 and then make it the current one by calling nvm use mysuperversion.

To make a specific version of Node a global one, you should create a default alias (or modify it if it already exists, the same way you create a new one).

like image 79
mdziekon Avatar answered Dec 31 '22 23:12

mdziekon