functions-samples: functions: Cannot start emulator
Hi there, Refer to issue #200 I try reinstall grpc but still getting same error
After install grpc it show success but grpc_node.node is installed via remote, like this
[grpc] Success: "/usr/local/lib/node_modules/grpc/src/node/extension_binary/node-v48-darwin-x64/grpc_node.node" is installed via remote
When run firebase deploy --only functions
it it showing
functions: Cannot start emulator. Error: Cannot find module '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node'
I checked in directory was nothing inside
/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary
Please give some advice, thank you in advance.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 19
- Comments: 35 (9 by maintainers)
I had the same issue when I ran on my Mac OS X High Sierra (not clear if this happens on Windows or Linux platforms)
sudo npm install -g firebase-tools
Error/Warning:
Here is what I did to avoid this:
sudo mkdir -p /usr/local/lib/node_modules/firebase-tools/node_modules/grpc/.node-gyp/8.9.1/
This creates an empty directory with the path specified then rerun the following:
sudo npm install -g firebase-tools
I hope this helps.
MyThinkPond | vguhesan
Similar issue - I’ve found various other threads on here related to this, but none of them seem to work. For me, somehow not only am I getting the above error: Cannot start emulator. Error: Cannot find module ‘/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node’
But for me when I use “sudo npm install -g grpc” I get the following error:
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.0/node-v57-darwin-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for grpc@1.7.0 and node@8.9.0 (node-v57 ABI) (falling back to source compile with node-gyp) gyp WARN EACCES user “root” does not have permission to access the dev dir “/Users/michaelrhanscom/.node-gyp/8.9.0” gyp WARN EACCES attempting to reinstall using temporary dev dir “/usr/local/lib/node_modules/grpc/.node-gyp”
Where the last 2 gyp warnings continue to populate on the screen over and over until I terminate the process. I tried to use “sudo npm install -g grpc --allow-root --unsafe” which seemed to work, but when I go back through the various folders, I still get down to '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node" and then beyond that the folder for “extension_binary” doesn’t even exist. Additionally, for the path within the above error, within the node_modules/grpc, the folder .node_gyp also doesn’t exist. Help?
If you need to use
sudo
to run anynode
ornpm
commands, if you have needed to usesudo
in the past for anynode
ornpm
command, or if you needed to usesudo
to install Node.js and npm, then this could indicate a problem with your Node.js installation.To remedy:
Completely wipe any trace of Node.js (including any modules installed via
npm
) from your system.Reinstall Node.js using nvm (or nvm-windows).
Install your desired version of Node.js. If you’re using the Emulator, install
v6.11.5
Now you may install Firebase tools (and the emulator), after switching to the right version of Node.js.
If you get any module version mismatch errors, it’s because you installed an npm module with native dependencies (in this case, the emulator) with one version of Node.js, and then you tried to run it with a different version of Node. It has to be installed and run with the same version of Node.js. Uninstall and reinstall with the right version of Node.js.
If you’re still having problems installing
grpc
, please open an issue on the grpc repo with details of your system environment.Also, as a side comment to others: grpc is a native node binary. Native binaries often only work with the version of Node for which they were compiled. If you are using
nvm
please make sure you’ve installed grpc on the same version of Node.I have this same issue. I’ve followed various steps referenced in this thread, but cannot get the emulator to start.
functions: Cannot start emulator. Error: Cannot find module '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/node-v48-darwin-x64-unknown/grpc_node.node'
Hi,
I am facing this error in windows. When i type firebase experimental:functions:shell , i get this error -
! functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/confi g'
I am able to run the function on server when i deploy . Please help, thanks