firebase-tools: Firebase serve return cannot find grpc_node.node module

Version info

3.9.2

Steps to reproduce

I run: firebase serve --only functions

Expected behavior

run functions localy

Actual behavior

get error: ⚠ functions: Cannot start emulator. Error: Cannot find module '/mnt/c/Users/Fares/AppData/Roaming/npm/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node'

I’m using Bash on windows, everything run on the right way, but this command give me error.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 24
  • Comments: 22 (2 by maintainers)

Most upvoted comments

exact same issue

sudo npm install -g grpc --allow-root --unsafe

allowed grpc to install

Hey everyone, I was having the same issue and I thought I would share how I fixed it. The main reason why it was throwing an error was the folder,node_modules/firebase-tools/node_modules/grpc/src/node, was missing. Running npm install -g firebase-tools, and even removing it before hand didn’t work. that /node folder in grpc was still missing.

I followed @stardotbmp suggestion and installed grpc as a global package by running their command. However, firebase wasn’t recognising it still. I went into the global firebase-tools instance, removed the grpc package, and replaced it with a symbolic link to the global grpc package.

The commands should be as follows:

sudo npm install -g firebase-tools

sudo npm install -g grpc --allow-root --unsafe

cd /path/to/global/node_modules/firebase-tools/node_modules

sudo rm -rf grpc

ln -s /path/to/node_modules/grpc/ /path/to/node_modules/firebase-tools/node_modules/grpc

cd /to/your/project/functions

firebase serve --only functions

None of these solutions seem to work - I have never really managed to get Firebase serve locally working… Maybe they should switch to local docker?

cd functions npm rebuild should do

yarn global add grpc works for me.

My previous error message was:

! functions: Cannot start emulator. Error: Cannot find module 'C:\Users\[User]\AppData\Local\Yarn\config\global\node_modules\grpc\src\node\extension_binary\node-v48-win32-x64-unknown\grpc_node.node' and I use nvm @ https://github.com/coreybutler/nvm-windows and installed node 6.11.5

This worked form me (I reinstalled firebase tool and update the firebase-functions):- npm install -g firebase-tools npm install firebase-functions@latest --save