0
0

More than 3 years have passed since last update.

Firebase Cloud Functions Node.js 8 のサポートを終了しました。

Posted at

久しぶりにCloud Functionsのコンソール画面を開くと、、

スクリーンショット 2020-11-08 14.23.29.jpg

「ん?何やこれ?笑」
そう思って、とりあえずさっきターミナルからデプロイした時のログを確認することに。

functions: Warning: Node.js 8 functions are deprecated and will stop running on 2021-03-15. Please upgrade to Node.js 10 or greater by adding an entry like this to your package.json:

    {
      "engines": {
        "node": "12"
      }
    }

The Firebase CLI will stop deploying Node.js 8 functions in new versions beginning 2020-12-15, and deploys from all CLI versions will halt on 2021-02-15. For additional information, see: https://firebase.google.com/support/faq#functions-runtime

とりあえずnodeのバージョンを上げろって事らしい

package.jsonを編集

functions/src/package.jsonを開く

package.json
{
  "name": "functions",
  "scripts": {
    "build": "tsc",
    "serve": "npm run build && firebase serve --only functions",
    "shell": "npm run build && firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "10"
  },
  "main": "lib/index.js",
  "dependencies": {
    "firebase-admin": "^9.3.0",
    "firebase-functions": "^3.11.0"
  },
  "devDependencies": {
    "typescript": "^3.2.2",
    "firebase-functions-test": "^0.1.6"
  },
  "private": true
}

"node": "10"に変更

そして依存関係を解消するためにターミナルからfunctionsの階層へ移動し、npm installを実行

npm install 

もう一度デプロイ

firebase deploy --only functions

とりあえず全てのfunctionをもう一度デプロイする。

スクリーンショット 2020-11-08 14.45.44.jpg

これでエラーは解消されましたね!

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0