Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase init "Node.js 8 has been deprecated." [duplicate]

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

like image 582
Michael Nelles Avatar asked Jun 19 '20 17:06

Michael Nelles


1 Answers

You have to change your package.json

Where you have:

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

change to:

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

As stated by firebase documentation.

like image 125
Danizavtz Avatar answered Nov 15 '22 18:11

Danizavtz