21
votes

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:

  1. npm install -g firebase-tools
  2. firebase login
  3. firebase init

and finally where I stucked is
4. firebase deploy

Please help me.

4
Make sure you've installed node modules in your functions directory: cd functions && npm installMichael Bleigh
Thanks ."cd functions" So is it necessary that there will be folder named functions?Pradeep.T
Okey thanks. It worked.I could successfully deploy my project.But now when I enter the project url ,which is get from the hosting tab in firebase console, in browser it shows "Site not found" message.What else I should be done?Please reply.Pradeep.T
I am having issues as well. Please see the following error: Invalid name: "@types/jsonwebtoken" Any clue?narko

4 Answers

9
votes

It's simple! If it says can't find module firebase-functions then install them.

npm install firebase-functions
6
votes

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.

4
votes

you should install node_modules in the functions directory in your project

cd functions
npm install 

then run firebase deploy

0
votes

Try this

import * as admin from "firebase-admin";