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

"Error: Port 5000 is not open, could not start functions emulator" when npm run serve #1605

Closed
peerasak-u opened this issue Aug 18, 2019 · 7 comments

Comments

@peerasak-u
Copy link

[REQUIRED] Environment info

node: 12.8.0
npm: 6.10.3

firebase-tools: 7.2.2

Platform: macOS

[REQUIRED] Test case

look step below

[REQUIRED] Steps to reproduce

run npm run serve command

[REQUIRED] Expected behavior

Run simulator cloud functions successfully

[REQUIRED] Actual behavior

[2019-08-18T02:34:58.696Z] ----------------------------------------------------------------------
[2019-08-18T02:34:58.704Z] Command:       /usr/local/Cellar/node/12.8.0/bin/node /usr/local/bin/firebase serve --only functions --debug
[2019-08-18T02:34:58.706Z] CLI Version:   7.2.2
[2019-08-18T02:34:58.706Z] Platform:      darwin
[2019-08-18T02:34:58.706Z] Node Version:  v12.8.0
[2019-08-18T02:34:58.707Z] Time:          Sun Aug 18 2019 09:34:58 GMT+0700 (Indochina Time)
[2019-08-18T02:34:58.707Z] ----------------------------------------------------------------------

[2019-08-18T02:34:58.714Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2019-08-18T02:34:58.715Z] > authorizing via signed-in user
[2019-08-18T02:34:58.715Z] [iam] checking project jrt-shop-fc0f1 for permissions ["firebase.projects.get"]
[2019-08-18T02:34:58.717Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/jrt-shop-fc0f1:testIamPermissions
 permissions=[firebase.projects.get]
[2019-08-18T02:35:00.198Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Sun, 18 Aug 2019 02:35:02 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=1140, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked
[2019-08-18T02:35:00.207Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/jrt-shop-fc0f1

[2019-08-18T02:35:00.720Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Sun, 18 Aug 2019 02:35:03 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43,39", accept-ranges=none, transfer-encoding=chunked

Error: Port 5000 is not open, could not start functions emulator.

@Jank1310
Copy link

for a quick fix see #1606 (comment)

@lookfirst
Copy link

One line fix on OSX:

sed -i '' 's/stopPort: port/stopPort: port+1/' node_modules/firebase-tools/lib/emulator/controller.js

@piscis
Copy link

piscis commented Aug 19, 2019

this is fixed in [email protected]

@gildotdev
Copy link

@piscis I just installed [email protected] yesterday and this error still occurred. I ran the one line fix above and the emulator started up.

@piscis
Copy link

piscis commented Aug 20, 2019

@gilcreque maybe you could give [email protected] also have a look at #1606 this is where the issue is tracked.

@LouieSankey
Copy link

LouieSankey commented Jan 17, 2020

does command +c stop the emulator? it takes me back to terminal but then I can't seem to call my functions anymore. I try to restart the emulator but then it gives me the error, port 5000 not open. How do I get back to the shell or call functions from terminal after I exit the emulator shell with command + c?

@bkendall
Copy link
Contributor

@LouieSankey if that is a reproducible behavior, could you please open a new Issue for that? If we're still holding on to ports, that wouldn't be great...

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

7 participants