Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js version and Google Cloud functions

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.)

like image 675
Leo Avatar asked Apr 24 '18 12:04

Leo


People also ask

Does Google Cloud support Nodejs?

Google Cloud lets you choose the best environment to run your Node. js applications, with options for serverless, Kubernetes, VMs, or custom hardware.

Is node 8 deprecated?

Node. js 8 has been deprecated. Starting Feb 15, 2021, we'll no longer support new deploys or updates of Node.


1 Answers

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.

like image 77
Doug Stevenson Avatar answered Sep 22 '22 13:09

Doug Stevenson