Managing Node versions

Luis Bajaña
1 min readJun 6, 2018

--

Recently I had a little nightmare trying to set up local debugging for Firebase Cloud Functions. I had to change the node version many times trying different setups (you know, a nightmare). I came across this answer on Stack Overflow about NVM, it was really easy to use and Install, considering that I was doing a trial and error process to make my setup work.

Installation: Open up your terminal, paste the following code and hit enter:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

Loading NVM: Just paste this command on your terminal and hit enter

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

Using NVM

There are three simple commands to change and install any node version you want, these commands are install, use and ls (list). Here’s a little example of how you use them on your terminal:

Installing a Node version:

nvm install 6.11.5

Changing Node version:

nvm use 8.2.1

Listing Node versions:

nvm ls

Remove an existing Node version

In my case, I have four different NodeJS versions running on my computer. To delete unwanted versions first you have to check if it’s not currently in use, if it is not you just have to execute:

nvm uninstall 6.11.5

6.11.5 is the Node version I wanted to delete it was currently in use so I had to change to 8.3.0 first. You can also use nvm deactivate

--

--

Luis Bajaña

Web and Mobile Developer, constantly inventing things.