Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase serve return cannot find grpc_node.node module #442

Closed
Faares opened this issue Aug 26, 2017 · 22 comments
Closed

Firebase serve return cannot find grpc_node.node module #442

Faares opened this issue Aug 26, 2017 · 22 comments
Assignees

Comments

@Faares
Copy link

Faares commented Aug 26, 2017

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.

@jenishngl
Copy link

+1

@jsdbroughton
Copy link

jsdbroughton commented Sep 11, 2017

exact same issue

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

allowed grpc to install

@chiragpurohit71085
Copy link

Thanks @stardotbmp

@tbass134
Copy link

updating firebase-admin to 5.5 seemed to work for me.

@gastzars
Copy link

+1

@factedu
Copy link

factedu commented Nov 24, 2017

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

@jdolan
Copy link

jdolan commented Dec 6, 2017

Still having this issue on OS X High Sierra, Node 8.9.1 via Macports, firebase-tools 3.16.0:

The-Dark-Zone:functions jdolan$ firebase serve --only functions

=== Serving from '/Users/jdolan/Coding/SyncThink/eyesync-cloud-functions'...

⚠  functions: Cannot start emulator. Error: Cannot find module '/opt/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node'

What's annoying is that grpc is installed locally in my functions/node_modules folder:

The-Dark-Zone:functions jdolan$ find . -name grpc_node.node
./node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node

I thought a clever symlink could get me past this:

cd /opt/local/lib/node_modules/firebase_tools/node_modules
sudo rm -rf grpc
sudo ln -s ~/path/to/functions/node_modules/grpc

But alas:

The-Dark-Zone:functions jdolan$ firebase serve --only functions

=== Serving from '/Users/jdolan/Coding/SyncThink/eyesync-cloud-functions'...

Error: An unexpected error has occurred.

@jdolan
Copy link

jdolan commented Dec 6, 2017

Turns out my error was permissions related. Symlink, or globally installing grpc as described above, is a valid workaround.

@CanadianEngineer
Copy link

CanadianEngineer commented Dec 12, 2017

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

@laurenzlong laurenzlong reopened this Dec 15, 2017
@laurenzlong laurenzlong self-assigned this Dec 15, 2017
@tevenFr
Copy link

tevenFr commented Dec 19, 2017

@CanadianEngineer thanks, it worked for me

@henrylearn2rock
Copy link

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

@grantkemp
Copy link

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?

@mbleigh
Copy link
Contributor

mbleigh commented Jan 29, 2018

Please direct all feedback regarding grpc installation to grpc/grpc-node#121 thanks!

@mbleigh mbleigh closed this as completed Jan 29, 2018
@simonthesupplier
Copy link

@CanadianEngineer Thank you, it worked for me.

@stevejboyer
Copy link

henrylearn2rock's comment above, regarding using yarn global add grpc did the trick for me!

@phatmann
Copy link

What finally worked for me was yarn add grpc in my functions directory. Every other solution above failed.

@laurenzlong
Copy link
Contributor

firebase-tools no longer requires grpc, upgrading to the newest version will work without any additional workarounds.

@sianlasaga
Copy link

Delete functions/node_modules -> yarn install

It worked and idk y.

@satyaavasarala
Copy link

cd functions
npm rebuild should do

@ggaabe
Copy link

ggaabe commented Sep 20, 2018

npm install firebase-functions@latest --save;
npm install firebase-admin@latest --save

Inside the functions folder fixed this for me.

@jhoansebastianlara
Copy link

jhoansebastianlara commented Oct 20, 2018

I just removed node_modules and install again:

rm -rf node_nodules/
npm install

@lfernando-silva
Copy link

run npm install with sudo solved the problem for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests