When I am trying to deploy a firebase project it shows an error message 'cannot find module firebase-functions' in npm console.The steps(node commands) I have done are:
and finally where I stucked is
4. firebase deploy
Please help me.
It's simple! If it says can't find module firebase-functions then install them.
npm install firebase-functions
Could be that you didn't follow the instructions provided when running "firebase init". You should press space and then enter in order to select the option you want - possibly that's why there was no functions folder.
you should install node_modules in the functions directory in your project
cd functions
npm install
then run firebase deploy
This may happen if you have requires with wrong cases!
The firebase function file system seems to be case sensitive.
So if you do
const { myStuff } = require('./mystuff');
but the file is actually named myStuff.js
, it may very well work locally, but fails on build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With