-
Notifications
You must be signed in to change notification settings - Fork 115
Installation
Before installing the Emulator, make sure you have a working installation of Node.js. We do not recommend using any system-provided Node.js, nor do we recommend installing Node.js via a Linux package manager. We recommend installing and managing your Node.js installations via nvm (Node Version Manager). You should not need to use sudo
to install or run the Emulator. For more information see Setting up a Node.js Development Environment.
Note: After installation, you can use the alias functions-emulator
in the case that your PATH or shell already has a functions
command.
npm install -g @google-cloud/functions-emulator
Adds the functions
command (and its alias functions-emulator
) to your PATH.
yarn global add @google-cloud/functions-emulator
Adds the functions
command (and its alias functions-emulator
) to your PATH.
git clone https://github.com/GoogleCloudPlatform/cloud-functions-emulator
wget https://github.com/GoogleCloudPlatform/cloud-functions-emulator/archive/master.zip
wget https://github.com/GoogleCloudPlatform/cloud-functions-emulator/archive/master.tar.gz
Once you've got a cloud-functions-emulator
directory, you need to install dependencies:
NPM:
cd cloud-functions-emulator
npm install --production
Yarn:
cd cloud-functions-emulator
yarn --production
The binaries are available at:
-
bin/functions
- The CLI, you could symlink this into/usr/local/bin
or something -
bin/emulator
- The Emulator service
If you see Error: Module version mismatch
, that means you installed the Emulator with one version of Node, then changed versions of Node without re-installing the Emulator.
The fix:
- Uninstall the Emulator.
- Re-install the Emulator.
A proper installation of Node.js and npm
should not require the use of sudo
. You should not have to sudo npm install
anything, nor should you have to sudo node
anything. For more information see Setting up a Node.js Development Environment.
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.