firebase functions:shell - Port 5000 is not open, could not start functions emulator
See original GitHub issue[REQUIRED] Environment info
firebase-tools: 7.2.2
Platform: macOS
[REQUIRED] Test case
firebase functions:shell
[REQUIRED] Steps to reproduce
$ npm install -g firebase-tools
$ npm install firebase-functions@latest firebase-admin@latest --save
firebase functions:shell
[REQUIRED] Expected behavior
firebase shell runs as advertised
[REQUIRED] Actual behavior
CLI Output: Port 5000 is not open, could not start functions emulator.
firebase-debug.log
[debug] [2019-08-18T03:02:45.322Z] ----------------------------------------------------------------------
[debug] [2019-08-18T03:02:45.324Z] Command: /usr/local/bin/node /usr/local/bin/firebase functions:shell
[debug] [2019-08-18T03:02:45.324Z] CLI Version: 7.2.2
[debug] [2019-08-18T03:02:45.324Z] Platform: darwin
[debug] [2019-08-18T03:02:45.324Z] Node Version: v10.15.3
[debug] [2019-08-18T03:02:45.330Z] Time: Sat Aug 17 2019 23:02:45 GMT-0400 (Eastern Daylight Time)
[debug] [2019-08-18T03:02:45.330Z] ----------------------------------------------------------------------
[debug]
[2019-08-18T03:04:19.141Z] > 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-18T03:04:19.141Z] > authorizing via signed-in user
[2019-08-18T03:04:19.142Z] [iam] checking project ddme-329f1 for permissions ["firebase.projects.get"]
[2019-08-18T03:04:19.143Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/ddme-329f1:testIamPermissions
permissions=[firebase.projects.get]
[2019-08-18T03:04:24.132Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Sun, 18 Aug 2019 03:04:23 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=111, 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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:16
- Comments:24 (3 by maintainers)
Top Results From Across the Web
Firebase serve error: Port 5000 is not open. Could not start ...
first, close all tab restart VS code then just go in firebase.json file then change ui port ...
Read more >[Solved] Port 5000 is not open, could not start functions emulator
Firebase is a backend platform to build web, mobile apps. If you get the following error message "Port 5000 is not open, could...
Read more >Javascript – Firebase serve error: Port 5000 is not open. Could ...
I'm trying to serve firebase functions locally, but when I run firebase serve or firebase emulators:start the error message is: "Port 5000 is...
Read more >how do u solve this error in firebase "Port 5000 is not open ...
how do u solve this error in firebase "Port 5000 is not open on localhost, could not start functions emulator.".
Read more >Could not start Functions Emulator, port taken Code Example
Port 5000 is not open on localhost, could not start functions emulator. shell by Strange ... More “Kinda” Related Answers View All Shell/Bash...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems to be related to the new portfinder release. https://github.com/http-party/node-portfinder/issues/84
The code used by the emulator fails with the latest version (1.0.22):
A workaround could be (besides using the old 1.0.21 version) :
QuickFix Edit the file
firebase-tools/lib/emulator/controller.js
in node_modules and changeyield pf.getPortPromise({ port, stopPort: port })
toyield pf.getPortPromise({ port, stopPort: port + 1 })
There is an open pull request which fixes this “bug”: https://github.com/http-party/node-portfinder/pull/86
In case someone want to find global
node_modules
to apply the quick fix. you can runnpm root -g
to see where your globalnode_modules
are.