node version code example

Example 1: node default version

# Install the version that you would like 
nvm install 6.1.0

# Set 6.1.0 (or another version) as default
nvm alias default 6.1.0

Example 2: check node version

node --version  
//or
node -v

//v12.15.0

Example 3: update nodejs mac

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

Example 4: find node version

node -v

OR

node --version

Example 5: get local node version

node --version

Tags:

Misc Example