TransWikia.com

Firebase CLI deployment warning: The Node.js 8 runtime is deprecated and will be decommissioned on 2020-12-05

Stack Overflow Asked by Mr. Baks on December 5, 2021

I am trying to learn how to deploy the typescript onto my FCF but it seems not doing the deployment that it should do like in the documentation and the official video of firecasts. When I tried to deploy my default code of helloworld instead of typescript, it is deploying node.js file which is I don’t understand why? Below are some json files and ts files, Please take a look at those generated files.

tsconfig.json
{
  "compilerOptions": {
    "module": "commonjs",
    "noImplicitReturns": true,
    "noUnusedLocals": true,
    "outDir": "lib",
    "sourceMap": true,
    "strict": true,
    "target": "es2017"
  },
  "compileOnSave": true,
  "include": [
    "src"
  ]
}
package.json
{
  "name": "functions",
  "scripts": {
    "lint": "./node_modules/.bin/tslint -p tslint.json",
    "build": "./node_modules/.bin/tsc",
    "serve": "npm run build && firebase emulators:start --only functions",
    "shell": "npm run build && firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "8"
  },
  "main": "lib/index.js",
  "dependencies": {
    "firebase-admin": "^8.10.0",
    "firebase-functions": "^3.6.0"
  },
  "devDependencies": {
    "tslint": "^5.12.0",
    "typescript": "^3.2.2",
    "firebase-functions-test": "^0.2.0"
  },
  "private": true
}
index.ts

import * as functions from 'firebase-functions';

// Start writing Firebase Functions
// https://firebase.google.com/docs/functions/typescript

export const helloWorld = functions.https.onRequest((request, response) => {
 response.send("Hello from Firebase!");
});

Lastly here is the result when deploying the code:

=== Deploying to 'gym-system-63a51'...

i  deploying functions
Running command: npm --prefix functions run build

> functions@ build C:UsersFX504GE-EN179TDesktopClustore_AppMapboxTestTypeScriptfunctions
> tslint -p tslint.json && tsc

Running command: npm --prefix "$RESOURCE_DIR" run lint

> functions@ lint C:UsersFX504GE-EN179TDesktopClustore_AppMapboxTestTypeScriptfunctions
> tslint -p tslint.json

Running command: npm --prefix "$RESOURCE_DIR" run build

> functions@ build C:UsersFX504GE-EN179TDesktopClustore_AppMapboxTestTypeScriptfunctions
> tslint -p tslint.json && tsc

+  functions: Finished running predeploy script.
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...

!  functions: The Node.js 8 runtime is deprecated and will be decommissioned on 2020-12-05. For more information, see: https://firebase.google.com/support/faq#functions-runtime

+  functions: required API cloudfunctions.googleapis.com is enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (29.86 KB) for uploading
+  functions: functions folder uploaded successfully
i  functions: updating Node.js 8 function helloWorld(us-central1)...
+  functions[helloWorld(us-central1)]: Successful update operation.

+  Deploy complete!

enter image description here

I have a hunch that the engines in package.json is the reason? But I don’t know what number I should update it with. Thank you!

One Answer

The node 8 runtime is deprecated and will be discontinued. Follow the link in the warning message for more information. You will need to migrate to node 10 eventually. Minimally, you will need to make sure this is set in your package.json:

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

Answered by Doug Stevenson on December 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP