-
Notifications
You must be signed in to change notification settings - Fork 115
Troubleshooting
The Emulator needs Node.js v6.11.1 or newer. It also has a dependency on grpc
which has native bindings, so your system needs to be able to install packages with native bindings.
Try this:
npm uninstall -g @google-cloud/functions-emulator
npm cache clean
-
node -v
(verify this outputs v6.11.1 or newer) npm install -g @google-cloud/functions-emulator
If you're using the Emulator via Firebase Tools, then you'll want to do:
npm uninstall -g @google-cloud/functions-emulator
npm uninstall -g firebase-tools
npm cache clean
-
node -v
(verify this outputs v6.11.1 or newer) -
npm install -g firebase-tools
(this will re-install the Emulator)
The Emulator may fail to start for several reasons:
- The Emulator is already running.
- A port needed by the Emulator is already in use.
- You're using an unsupported version of Node.js.
- You're attempting to run the Emulator using a version of Node.js that is different than the version of Node.js that you used to install the Emulator. They must be the same.
If you're using NVM and doing a bunch of switching back and forth on your Node.js version, then you may run into issues starting the Emulator.
The grpc
dependency with native bindings is finicky. Wiping any trace of the Emulator from your system and re-installing often fixes the issue:
npm uninstall -g @google-cloud/functions-emulator
npm cache clean
-
node -v
(verify this outputs v6.11.1 or newer) npm install -g @google-cloud/functions-emulator
-
Make sure the Emulator is running:
functions status
-
Make sure your function's JavaScript code does not have any parse or runtime errors.
-
Check the Emulator's logs:
functions logs read
functions config set verbose true
functions restart
- Do stuff (deploy/call a function)
functions logs read
Use functions-emulator
instead.
Disclaimer: This is not an official Google product.
@google-cloud/functions-emulator is currently in pre-1.0.0 development. Before the 1.0.0 release, backwards compatible changes and bug fixes will bump the patch version number and breaking changes will bump the minor version number.