Torbjorn Zetterlund

Sun 21 2019
Image

Downgrading Node from 10.x to 8.x

by bernt & torsten

I’m working on a Firebase Cloud function, I run into an issue when I tested the function locally on mine machine. I got the message – “Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail”. Searching Google for why I get this issue on my local machine, show that there is an issue with running Firebase Cloud function in Node 10.

I needed to downgrade the Node versions quickly, going forward having the ability to switch quickly will be helpful while developing, so here are my notes for managing which version is currently installed.

Determining your Node version

Which version of Node is currently installed.

node -v

The version number displayed is the one that’s currently active on your machine. Now, let’s install a program called n that will let us easily switch between Node versions.

sudo npm install -g n

Upgrading to the latest stable version

Once n is installed, this simple command will update you to the latest stable version of Node.

sudo n stable

Changing to a specific version

If you need a specific version, simply specify the version number you want like this.

sudo n 10.16.0

Here you can find the node.js versions – https://nodejs.org/en/download/releases/

Share: