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

Error: Failed to load gRPC binary module because it was not installed for the current system #1719

Closed
TOMZACH opened this issue Oct 11, 2019 · 7 comments

Comments

@TOMZACH
Copy link

TOMZACH commented Oct 11, 2019

I follow the instructions here https://firebase.google.com/docs/cli#npm
I run npm install -g firebase-tools , login and then run firebase serve and receive the following error

Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v57-darwin-x64-unknown
Found: [node-v64-darwin-x64-unknown]

Ive tried running npm rebuild as suggested on other threads and on stack exchange but the error persists. Any ideas of what can be done to fix this. I've tried uninstalling and reinstalling the node_modules but still the problem persists. Any ideas of what can be done.

I'm running
npm version 6.9.0
Firebase CLI version 7.5.0
MacOS Catalina 10.15

@bkendall
Copy link
Contributor

ooo - I have weird hunches about this that aren't going to be fun related to Catalina...

Can you tell me where the following executable files live on your machine? which will probably be the best tools for this...

  • node
  • npm
  • firebase

A quick-ish version of this question is: how did you install NodeJS on your machine?

@bkendall bkendall added the Needs: Author Feedback Issues awaiting author feedback label Oct 16, 2019
@TOMZACH
Copy link
Author

TOMZACH commented Oct 18, 2019

It is interesting you say that it is from Catalina I have only noticed this on my machine running Catalina, I purposely left my other computer in Mojave and have not been experiencing this issue.

I downloaded node.js from the node.js website using https://nodejs.org/en/
here are outputs from the requested which commands.

which npm

/usr/local/bin/npm

which firebase

/usr/local/bin/firebase

which node

/usr/local/bin/node

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels Oct 18, 2019
@bkendall
Copy link
Contributor

So, I don't know all of the details I'm talking about here, but my understanding is that Catalina separated user and system space on the file system and things that attempt to cross those boundaries have some odd behaviors.

I don't have a setup to test this now myself, but I may be able to look into it later. What I would recommend for you:

  1. Try: uninstall Node and reinstall it using a fresh download from nodejs.org - that may allow macOS to put the appropriate permissions in place for you to be able to run what you need. Try reinstalling firebase-tools and going about your workflow. (There's a second option here that you may need to give Node JS full access to your file system or something, but I'm not 100% sure how to advice this).
  2. Workaround: use nvm. It installs node in your home directory which will have the correct permissions in your system. This should unblock you and allow you to install firebase-tools and go about your workflow.

Let me know if that works for you!

@bkendall bkendall added Needs: Author Feedback Issues awaiting author feedback and removed Needs: Attention labels Oct 18, 2019
@TOMZACH
Copy link
Author

TOMZACH commented Oct 21, 2019

Thank you for your continued help.

Its funny I uninstalled node.js manually and then installed using nvm everything seemed fine. I ran firebase serve and got a differnent error

firebase serve

=== Serving from '/Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions'...

⚠ Your requested "node" version "8" doesn't match your global version "12"
✔ functions: Emulator started at http://localhost:5001
i functions: Watching "/Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions" for Cloud Functions...
i hosting: Serving hosting files from: y
✔ hosting: Local server: http://localhost:5000
⚠ Error: Cannot find module '/Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node'
Require stack:

  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/@firebase/firestore/node_modules/grpc/src/grpc_extension.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/@firebase/firestore/node_modules/grpc/src/client_interceptors.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/@firebase/firestore/node_modules/grpc/src/client.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/@firebase/firestore/node_modules/grpc/index.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/@firebase/firestore/dist/index.node.cjs.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/firebase/dist/index.node.cjs.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/admin.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/index.js
  • /Users/a123456/.nvm/versions/node/v12.12.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/@firebase/firestore/node_modules/grpc/src/grpc_extension.js:32:13)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    ⚠ We were unable to load your functions code. (see above)

so I googled the error and followed this advise #442 (comment)

which got me to this error

firebase serve

=== Serving from '/Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions'...

⚠ Your requested "node" version "8" doesn't match your global version "12"
✔ functions: Emulator started at http://localhost:5001
i functions: Watching "/Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions" for Cloud Functions...
i hosting: Serving hosting files from: y
✔ hosting: Local server: http://localhost:5000
⚠ Error: The gRPC binary module was not installed. This may be fixed by running "npm rebuild"
Original error: Cannot find module '/Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/grpc/src/node/extension_binary/node-v72-darwin-x64-unknown/grpc_node.node'
Require stack:

  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/grpc/src/grpc_extension.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/grpc/src/client_interceptors.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/grpc/src/client.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/grpc/index.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/admin.js
  • /Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/index.js
  • /Users/a123456/.nvm/versions/node/v12.12.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js
    at Object. (/Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/grpc/src/grpc_extension.js:43:17)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/Users/a123456/Desktop/Tile Cloud Functions copy/cloud-functions/functions/node_modules/grpc/src/client_interceptors.js:144:12)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    ⚠ We were unable to load your functions code. (see above)

Any ideas of where to go from here?

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels Oct 21, 2019
@bkendall
Copy link
Contributor

Try running firebase serve using Node 8 rather than node 12. The higher versions of node sometimes don't play nicely, so odd issues can appear like this.

@bkendall bkendall added Needs: Author Feedback Issues awaiting author feedback and removed Needs: Attention labels Nov 11, 2019
@google-oss-bot
Copy link
Contributor

Hey @TOMZACH. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@TOMZACH if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

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

No branches or pull requests

3 participants