LoginSignup
9
4

More than 5 years have passed since last update.

Firebase Cloud FunctionsでNode.js v8を使う

Last updated at Posted at 2018-07-31

ローカルで

$ firebase serve --only hosting,functions

とかやると

Warning: You're using Node.js v8.9.4 but Google Cloud Functions only supports v6.11.5.

上記のようなメッセージが出てしまいます。v6.11.5.しかサポートしていないんですね。

個人的にはasync/awaitを使いたくて、絶望していました。

しかし先日以下の記事を発見しました。

The Node.js 8 Runtime  |  Cloud Functions Documentation  |  Google Cloud

Google Cloudではベータ版という位置づけでNode.js 8が使えるようです!

ということでGoogle Cloudのコンソール画面に行き、Firebaseで使っているfunctionsのRuntimeをNode.js 8にしたら…

$ firebase deploy --only hosting,functions
・
・
✔  functions[ssrapp(us-central1)]: Successful update operation.

✔  Deploy complete!

async/awaitを使用しているfunctionsのdeployが成功しました(以前は失敗していた)!

9
4
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
9
4