Node.js version and Google Cloud functions

Leo picture Leo · Apr 24, 2018 · Viewed 7.8k times · Source

I get this message when I start a local Firebase server with firebase serve:

Warning: You're using Node.js v8.9.4 but Google Cloud Functions only supports v6.11.5.

But there is no info about what to do. What do I need to do to downgrade Node.js to v6.11.5? Should I use that version just for Firebase projects and the latest released version of Node.js for other projects? In that case how to I do that?


EDIT: The warning now looks like this and I am unable to run a new nearly empty project:

Warning: You're using Node.js v8.9.4 but Google Cloud Functions only supports v6.11.5.
!  functions: Failed to load functions source code. Ensure that you have the latest SDK by running npm i --save firebase-functions inside the functions directory.
!  functions: Error from emulator. mod.hasOwnProperty is not a function

So I really think I have to downgrande Node.js. But I do not know how to safely do that. Hm, looking at http://nodejs.org/ I can't even find version v6.11.5?


EDIT 2: Just checked in the new project if npm update --dev fixed the problem. It did not. (Actually no packages where updated.)

Answer

Doug Stevenson picture Doug Stevenson · Apr 24, 2018

That's just a warning. You can ignore it if you know what you're doing. It's telling you that your local emulation of a function (running on node 8.9.4) may not perfectly match what the function will do when it's deployed to Cloud Functions (running 6.11.5). But as long as you're not using any features of node that are not available on node 6.11.5, you won't have a problem. I use newer versions of node to test locally all the time without problems.