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)
exact same issue
sudo npm install -g grpc --allow-root --unsafeallowed 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. Runningnpm install -g firebase-tools, and even removing it before hand didn’t work. that/nodefolder ingrpcwas 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-toolssudo npm install -g grpc --allow-root --unsafecd /path/to/global/node_modules/firebase-tools/node_modulessudo rm -rf grpcln -s /path/to/node_modules/grpc/ /path/to/node_modules/firebase-tools/node_modules/grpccd /to/your/project/functionsfirebase serve --only functionsNone 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 functionsnpm rebuildshould do+1
yarn global add grpcworks 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.5This worked form me (I reinstalled firebase tool and update the firebase-functions):- npm install -g firebase-tools npm install firebase-functions@latest --save