Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can the default node version be set using NVM?

I have installed nvm (ubuntu with zsh shell) with two node version: v6.11.5 and v9.0.0 and the default version in nvm is the v9.0.0

Every time I need to change the node version

$ nvm list          v6.11.5 ->       v9.0.0          system default -> node (-> v9.0.0) node -> stable (-> v9.0.0) (default) stable -> 9.0 (-> v9.0.0) (default)   $ nvm v6 

How could I change the nvm version default to define v6.11.5?

like image 709
Pablo Ezequiel Inchausti Avatar asked Nov 08 '17 22:11

Pablo Ezequiel Inchausti


People also ask

How do I change node version in NVM?

Switching among Node. 7; we can simply run either nvm use 12.22. 7 or nvm use 16.13. 0 to easily switch into either version we need. Note that since we only have one version that begins with 12, 14, or 16, we can switch versions with a simple nvm use 16 , nvm use 14 , or nvm use 12 command.

Does NVM set npm version?

nvm manages node. js and npm versions. It's designed to be installed per-user and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.


1 Answers

(nvm maintainer here)

nvm alias default 6.11.5 if you want it pegged to that specific version.

You can also do nvm alias default 16.

Either way, you'll want to upgrade to the latest version of nvm (v0.33.11 as of this writing)

like image 175
LJHarb Avatar answered Oct 26 '22 05:10

LJHarb