LoginSignup
14
10

More than 3 years have passed since last update.

Cloud Functions for FirebaseでNode.js 12を利用する方法

Posted at

公式ドキュメントの「ランタイム オプションを設定する」の項目には Node.js のバージョン 12 が使えることが書かれていますが、その利用方法までは書かれていなかったのでこの記事で説明します。


一見、ドキュメントにあるように

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

の箇所を12とすれば動きそうですが、ここに書いても動作しません。

Node.js の 12 を利用するためには、firebase-toolsのバージョンを8.6.0以上に上げたうえでfirebase.json"runtime": "nodejs12"を指定しましょう。

{
  "functions": {
    "runtime": "nodejs12"
  }
}

参考:firebase/firebase-tools/releases/tag/v8.6.0


Firebase 関連のパッケージはここ最近バージョンアップが頻繁に行われている印象で、ドキュメントも追いついていないっぽいので現在の情報が知りたい方はパッケージのリリース情報にも目を通していったほうがいいかもしれません。

14
10
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
14
10