Firebase: Cannot start emulator

firebase emulators:start
firebase emulators:exec
debug firebase functions locally
error: emulators:start is not a firebase command
run firestore locally
storage.googleapis.com emulator
run firebase functions locally
firebase run only functions

functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'

This is the error message I get when I try to run functions locally on Mac. My Firebase version is 3.16.0. I tried doing sudo npm install -g @google-cloud/functions-emulator as well. But still no use. Please help.

Solution is:

yarn global add firebase-tools
yarn global add @google-cloud/functions-emulator --ignore-engines

Firebase: Cannot start emulator, Solution is: yarn global add firebase-tools yarn global add @google-cloud/​functions-emulator --ignore-engines. Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Working Solution!(OSX) None of the above worked for me. After a long struggle, I found the following solution.

cd my_project/functions

npm install @google-cloud/functions-emulator

Copy @google-cloud/functions-emulator folder generated inside node_modules.

cd /usr/local/lib/node_modules/@google-cloud && open .

Paste the functions-emulator folder here.

In your project's root directory, copy package.json inside functions/node_modules/@google-cloud/functions-emulator

cd /usr/local/lib && open .

Paste the package.json here.

npm install

Hurray! You are good to go. Now go back to your project's root directory and run.

sudo firebase serve --only hosting,functions

And the emulator should start normally.

Note: Do not run sudo npm install -g @google-cloud/functions-emulator since the files will be removed and reinstalled. This is where the installation fails and emulator fails to run.

Hope this helps!

google cloud functions - Firebase: Cannot start emulator, Error: Cannot find module '@google-cloud/functions-emulator/src/config'. This is the error message I get when I try to run functions locally on Mac. My Firebase  The Firebase Emulators make it easier to fully validate your app's behavior and verify your Firebase Security Rules configurations. Use the Firebase Emulators to run and automate unit tests in a local environment.

The following worked for me.

  1. npm uninstall -g firebase-tools && npm i -g firebase-tools
  2. npm i --save @google-cloud/firestore
  3. npm i --save @google-cloud/common-grpc
  4. npm i -g @google-cloud/functions-emulator
  5. npm i --save firebase-functions

current package.json snippet

"dependencies": {
    "@google-cloud/common-grpc": "^0.5.3",
    "@google-cloud/firestore": "^0.11.1",
    "firebase-functions": "^0.8.1",
    "firebase-admin": "5.8.1" 
}

Set up the Firebase Emulators, Start the emulator using the following command. The emulator runs during all your tests. * { Cloud Firestore }. firebase emulators:start --  @vguhesan You're continuing to dig yourself into the "sudo" rabbit hole, which is a bit dangerous. Any exploit of a Node tool on your system could lead to a full compromise of your development machine.

My system: Ubuntu 16.04.3

I had the same problem and the reason is that "@google-cloud/functions-emulator" is not installed in the 'npm global packages folder'.

In my case it happened because I installed firebase-tools globally using yarn, and I used it because when installing firebase-tools globally using npm I was getting an folder access error, which did not happen with yarn.

What I did to solve the problem was to follow these simple instruction from npm website to use a different folder for npm global packages (https://docs.npmjs.com/getting-started/fixing-npm-permissions).

Then I installed again with 'npm install -g firebase-tools' (without sudo) and it worked perfectly.

Run functions locally, The emulators:start command will start emulators for Cloud Functions, Cloud Firestore, Realtime Database, and Firebase Hosting based on the  The Emulator UI allows you to shift away from needing the online connected project and lets you start your development workflow with local instances. Features to boost productivity. The Emulator UI is not an exact copy of the online Firebase console. It's tailored for the functionality you need while developing.

I had the same problem, using Ubuntu 17.10.

Note: You do not need to, and should not, use sudo for the installation.

I resolved this by performing the following:

  1. Uninstall any previously attempted installed of the functions emulator.

    npm uninstall -g @google-cloud/functions-emulator
    

    and to make sure:

    yarn global remove @google-cloud/functions-emulator
    
  2. Delete all files in ~/.config/configstore/@google-cloud/functions-emulator. Note that there are some hidden files in this directory.

    rm -rf ~/.config/configstore/@google-cloud/functions-emulator
    
  3. Install nvm (node version manager) by following the instructions here:

    https://github.com/creationix/nvm#install-script

  4. Use nvm to install a specific version of node - at the time of writing, the Google Cloud Function Emulator (version 1.0.0-alpha.29) specifically requires 6.11.5.

    nvm install 6.11.5
    
  5. Install the Google Cloud Platform SDK:

    https://cloud.google.com/sdk/

  6. Reinstall the functions emulator:

    npm install -g @google-cloud/functions-emulator
    
  7. Start the emulator to verify installation has succeeded:

    functions start
    

IMPORTANT: Subsequently, when attempting to create a function that can be tested locally or deployed to Google Cloud, you should use the firebase init functions command within your project, and allow this to install dependencies via npm. A walkthrough of creating a test function with Firebase can be found here:

https://firebase.google.com/docs/functions/get-started

"Cannot start emulator", Community content may not be verified or up-to-date. 8/16/17 Daniel Luke. I going through David East's You Tube tutorial on Firebase Hosting for NodeJs apps  firebase emulators:start. The emulators:start command will start emulators for Cloud Functions, Cloud Firestore, Realtime Database, and Firebase Hosting based on the products you have initialized in your local project using firebase init. If you want to start a particular emulator, use the --only flag: firebase emulators:start --only functions

Getting started with the Firebase Local Emulator Suite, In this codelab, you run and debug a simple online shopping app which is powered by multiple Firebase services: Cloud Firestore: A globally scalable, serverless,  You received this message because you are subscribed to the Google Groups "Firebase Google Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal@googlegroups.com.

Firebase: Cannot start emulator - firebase - html, Error: Cannot find module '#google-cloud/functions-emulator/src/config' This is the error message I get when I try to run functions locally on Mac. My Firebase  To avoid crashes and hangs caused by not having enough free disk space, the emulator checks for sufficient free disk space on startup, and will not start unless at least 2 GB is free. If the emulator fails to start for you, check to see that you have adequate free disk space.

Say hello to the helpful Firebase Emulator - a , You can write that code, run it locally, and then create a document in the The Emulator Suite doesn't just help with developer productivity,  Start the emulator from the command line as described in the previous section, using any startup options necessary. Install your app using adb. Run and test your app on the emulator. While the emulator is running, you can also use the Emulator Console to issue commands as needed.