13

When I run firebase init to start a new project the package.json file is created automatically (as below) when I go to the firebase dashboard it then throws this warning"

Starting NaN, NaN, we'll no longer support new deploys or updates of Node.js 8 functions.
Starting NaN, NaN, we'll no longer support executions of existing Node.js 8 functions.

how do you init and specify the version? Or what is the workaround?

{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "lint": "eslint .",
    "serve": "firebase emulators:start --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "8"
  },
  "dependencies": {
    "firebase-admin": "^8.10.0",
    "firebase-functions": "^3.6.1"
  },
  "devDependencies": {
    "eslint": "^5.12.0",
    "eslint-plugin-promise": "^4.0.1",
    "firebase-functions-test": "^0.2.0"
  },
  "private": true
}

** moderator I did not come across similar questions because they way it was worded did not show up in google. This post per day traffic is evidence that it is helpful for the community** enter image description here

Michael Nelles
  • 5,426
  • 8
  • 41
  • 57
  • You will need to migrate to node 10. https://medium.com/firebase-developers/migrate-your-firebase-cloud-functions-to-node-js-10-d9c677933ee – Doug Stevenson Jun 19 '20 at 17:06

1 Answers1

28

You have to change your package.json

Where you have:

"engines": {
    "node": "8"
  }

change to:

"engines": {
    "node": "10"
  },

As stated by firebase documentation.

Danizavtz
  • 3,166
  • 4
  • 24
  • 25
  • Go to google cloud function>click edit>change the dropdown to node 10> change the ```"engines": { "node": "8" }``` to ```"engines": { "node": "10" }``` click save – noe Jul 06 '20 at 05:32