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

Cannot start emulator #552

Closed
spidi123q opened this issue Dec 1, 2017 · 42 comments
Closed

Cannot start emulator #552

spidi123q opened this issue Dec 1, 2017 · 42 comments

Comments

@spidi123q
Copy link

when i try to run firebase serve --only functions
it gives following error and runs only hosting
functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'

@justinrosenthal
Copy link

Sounds like the emulator may have failed to install when you installed firebase-tools (it's an optional dependency, so it's possible). Could you try re-running npm install -g firebase-tools and inspect the output to confirm @google-cloud/functions-emulator got pulled in with it?

@inlined
Copy link
Member

inlined commented Dec 11, 2017

Ping? Would love to hear back from you or we'll close for inactivity

@danielsada
Copy link

I did the same thing, I installed and reinstalled the modules to no avail.

➜ firebase serve --only functions

=== Serving from ''...

⚠ functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'
➜ npm install -g firebase-tools
npm WARN deprecated [email protected]: Use uuid module instead
/home//.npm-global/bin/firebase -> /home//.npm-global/lib/node_modules/firebase-tools/bin/firebase

=== Serving from ''...

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

@jesper-bylund
Copy link

Same here. Been this way for a few days. Even after the update today.

@laurenzlong
Copy link
Contributor

@danielsada and @raelmiu Can you try:

npm uninstall -g firebase-tools && npm i -g firebase-tools

@danielsada
Copy link

danielsada commented Jan 23, 2018

Did it, some of the notable warnings:
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node-v59-linux-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI) (falling back to source compile with node-gyp) make: Entering directory '/home/danielsada/.npm-global/lib/node_modules/firebase-tools/node_modules/grpc/build'
Then

`> @google-cloud/[email protected] postinstall /home//.npm-global/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator

node scripts/upgrade-warning`

Then finally, the same error

image

@1forh
Copy link

1forh commented Jan 24, 2018

I'm getting the same error. Have tried uninstalling and reinstalling.

@miransar
Copy link

Did anyone got this working ?. Still getting the same error.

screen shot 2018-01-25 at 12 59 38 pm

@jesper-bylund
Copy link

Same here. Installed node 6.11, reinstalled tools, still doesn't work.

@danielsada
Copy link

Can replicate in v3.17.2

@laurenzlong
Copy link
Contributor

Hi everyone, can you try v3.17.3? @Mir-Ansar yours looks to be a permission error, here's info on how to fix: https://docs.npmjs.com/getting-started/fixing-npm-permissions

@danielsada
Copy link

danielsada commented Jan 25, 2018 via email

@otnielgomez
Copy link

Is there any solution for this?

@laurenzlong
Copy link
Contributor

Sorry I can't reproduce the issue, it sounds like it is similar to googlearchive/cloud-functions-emulator#170 (comment). So you may want to +1 that issue.

Other things you can try are:

  • upgrading npm, and then uninstall, reinstall
npm i -g npm
npm unintall -g firebase-tools && npm i -g firebase-tools

@sstottelaar
Copy link

I have the same exact issue, tried most given solutions, nothing worked. Anyone got a solution in the meantime?

@AAverin
Copy link

AAverin commented Jan 28, 2018

grpc/grpc#13673

@tuguScript
Copy link

I'm getting the same error

@dsouzaedison
Copy link

I am not sure what exactly is causing this problem. But here is the working solution for this problem. StackOverflow - Firebase: Cannot start emulator

@RyanNewsom
Copy link

npm install -g @google-cloud/functions-emulator fixed this for me.

@jcoder76
Copy link

@RyanNewsom didn't solve it for me. Still broken.

@ofarukcaki
Copy link

Any working solution? My emulator was working but now it isn't

@petecarapetyan
Copy link

I have a couple similar projects, one working, one not working per above comments, as well as a firebase deployment that was working - now inexplicably not working. With the number of people suffering from this same fate both here and on stackOverflow over a period of many months, it would seem that a less brittle system might be in order.

@stefandeml
Copy link

reason for this problem is in most cases a wrong python version when installing firebase.

make sure you are using a shell with python 2 and then re-run:
npm install -g firebase-tools

@laurenzlong
Copy link
Contributor

The latest firebase-tools (v3.17.5) removes grpc as a dependency, which should resolve these issues. Please upgrade by running npm i -g firebase-tools

@jcoder76
Copy link

Fixed it for me.

@ddo
Copy link

ddo commented Sep 26, 2018

got the same issue when you have different node version than the node engine in package.json
solution:

below is yarn, feel free to use npm

# install current working directory dependencies
yarn --ignore-engines

# install firebase-tools if u didn't
yarn global add firebase-tools

# install functions-emulator
yarn global add @google-cloud/functions-emulator --ignore-engines

@bidipeppercrap
Copy link

⚠  functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'
(node:15281) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'exit' of undefined
    at /usr/local/lib/node_modules/firebase-tools/lib/command.js:82:34
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15281) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15281) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Tried @ddo methods but didn't work.

@bidipeppercrap
Copy link

bidipeppercrap commented Nov 7, 2018

⚠  functions: Cannot start emulator. Error: Cannot find module '@google-cloud/functions-emulator/src/config'
(node:15281) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'exit' of undefined
    at /usr/local/lib/node_modules/firebase-tools/lib/command.js:82:34
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15281) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15281) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Tried @ddo methods but didn't work.

Worked, after I:

  1. Reinstall Node & NPM using NVM
  2. delete firebase-tools on /usr/local/lib/node_modules (Or previous global package installed from root-level node)
  3. install firebase-tools without sudo (npm i -g firebase-tools)

@Zyntemirov
Copy link

sdfsdfadf

@rilian
Copy link

rilian commented Nov 13, 2018

i also had recently upgraded to using node 8 and had issues with firebase serve --only functions and firebase-tools not willing to fully install @google-cloud/[email protected]: The engine "node" is incompatible with this module. Expected version "~6". Got "8.1.0", but --ignore-engines is really helpful - now it runs fine, though gives a warning

[Jest Dev server] $ firebase serve --only functions -p 5000 -o 0.0.0.0
[Jest Dev server]
[Jest Dev server] === Serving from '/Users/xxx/project-name'...
[Jest Dev server]
[Jest Dev server] i  functions: Preparing to emulate functions.
[Jest Dev server] Warning: You're using Node.js v8.1.0 but Google Cloud Functions only supports v6.11.5.

@bidipeppercrap
Copy link

bidipeppercrap commented Nov 15, 2018 via email

@ElenaTv
Copy link

ElenaTv commented Nov 17, 2018

save me:
yarn global remove @google-cloud/functions-emulator
yarn global add https://github.com/GoogleCloudPlatform/cloud-functions-emulator#master

@neilpoulin
Copy link

I just had this issue after upgrading firebase-admin and some other firebase packages, too. I am running functions on node 8. I was able to fix the issue by ensuring that I installed firebase with --ignore-engines

@hrfmmymt
Copy link

If you are primarily using yarn in your project, use npm instead of yarn when installing firebase-tools.

yarn global remove firebase-tools
npm i - g firebase-tools

@maininformer
Copy link

Worked for me: I was running into this problem inside docker on mac. Nothing fixed it. Ended up installing it on mac, then copying it in docker's node_modules. That worked.

@joelclimbsthings
Copy link

Also having the above issue after migration to node 8 functions. Using, --ignore-engines as mentioned, although I still get this warning:

Warning: You're using Node.js v8.14.0 but Google Cloud Functions only supports v6.11.5.

@klausbreyer
Copy link

@Dygerati same for me.

@shaji-Dev
Copy link

This is what I get, anyone solved this issue?

functions: Cannot start emulator. Error: Cannot find module './acceleratedmobilepageurl/v1'
(node:16724) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'exit' of undefined
    at C:\....\node_modules\firebase-tools\lib\command.js:82:34
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:16724) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rej
ection id: 2)
(node:16724) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@olegdater
Copy link

npm install @google-cloud/functions-emulator --save-dev solved for me

@julianorinyol
Copy link

Okay so the the google cloud-functions-emulator "only supports Node v6.x.x. It does not support Node v8.x.x"
https://github.com/GoogleCloudPlatform/cloud-functions-emulator#note

The firebase docs on choosing node versions says you can use node 8 "engines": {"node": "8"}
but its in beta..
https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version

hmmm... so i can use node8, but i cannot test it locally using cloud functions shell (if i use node8 specific syntax)?
Do i have this right?

Firebase Team/Google Team, it would be helpful if you would put in the docs that the cloud functions emulator will not work with node 8
for example on this page, https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version have something like

"you can set your runtime to node 8, but if you test with google cloud-functions-emulator it will be using node6.x.x and any node8 specific syntax will not work "

a similar warning here would help
https://firebase.google.com/docs/functions/local-emulator#install_and_configure_the_cloud_functions_shell

also in the email you sent out (25 Feb 2019)
subject: [Action required] Changes to runtimes for new Cloud Functions deployments from April 1

@mbifulco
Copy link

mbifulco commented Apr 4, 2019

I got here with the exact same question as @julianorinyol - is there a plan for getting the emulator to the point where it is compatible with Node 8 syntax?

@chrisdobler
Copy link

using on node 8 (with yarn) this is what worked for me:
yarn add @google-cloud/functions-emulator --ignore-engines

bkendall added a commit that referenced this issue Sep 1, 2020
* hosting channel open command

* period.

* Update hosting-channel-open.ts

* Update hosting-channel-open.ts

* Update hosting-channel-open.ts

* Update hosting-channel-open.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests