"Cannot understand what targets to deploy/serve." の対処法

event
Firebase を使用して Web にデプロイするときに、
code
編集モード
firebase deploy --only functions
コマンドを実行すると、
code
編集モード
Error: Cannot understand what targets to deploy/serve. No targets in firebase.json match '--only functions'.
とエラーが出た時の対処法を残そうと思います。
結論
firebase init
コマンドを実行する際に、functions
の設定をしていなかったのが原因みたいです。
firebase init
コマンドをもう一度実行しましょう。
その時に、
◯ Functions: Configure a Cloud Functions directory and its files
を選ぶのを忘れなよいようにしましょう。
このようにすることで、firebase.json
にfunctions
ブロックが追加されます。
これで、functions
コマンドが使えるようになります。
code
編集モード
firebase deploy --only functions
を実行してもエラーが出なくなりました!
おわりに
最後までご覧いただきありがとうございます。
PC ロールでは、テクノロジーに関する情報をまとめて発信しています。
また、おすすめのガジェットについて幅広く紹介するガジェロールもあります。
ガジェットやソフトを使うエンジニア・クリエイターのみなさん、ぜひご覧ください。