Error: Error parsing triggers: Cannot find module 'firebase-functions'
事象
久々にfirebase Hostingにdeployしようとしたらエラーが出てデプロイできない。
$ firebase deploy === Deploying to 'my-app'... i deploying database, functions, hosting ✔ database: rules ready to deploy. i functions: ensuring necessary APIs are enabled... i runtimeconfig: ensuring necessary APIs are enabled... ✔ runtimeconfig: all necessary APIs are enabled ✔ functions: all necessary APIs are enabled i functions: preparing functions directory for uploading... Error: Error parsing triggers: Cannot find module 'firebase-functions' Try running "npm install" in your functions directory before deploying.
firebase-functionsが無いぜ!npm installしてね、というメッセージ内容。
1ヶ月前までfirebase deployで何事もなくデプロイできていたのに!
解決方法
functionsというディレクトリの中にpackage.jsonがあったので、これをインストールしればいいらしい。
つまり、functionsディレクトリ内で npm install
するだけ。
$ cd functions $ npm install ...
インストール完了後に再度デプロイしてみると
$ firebase deploy ... ✔ Deploy complete!
デプロイ成功!