-
Notifications
You must be signed in to change notification settings - Fork 954
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
firebase functions:shell - Port 5000 is not open, could not start functions emulator #1606
Comments
i am also having this problem. did you find a solution? OS: |
Seems to be related to the new portfinder release. 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 There is an open pull request which fixes this "bug": http-party/node-portfinder#86 |
I can confirm the QuickFix is working for me. Firebase Tools: 7.2.2 |
This works fine! Thank you! |
where is? node_modules/firebase-tools/lib/emulator/controller.js |
It's in your global node_modules dir, not in the project one. |
@meltedmoon the mentioned node_modules is not the node_modules in your project folder, but rather the node_modules for the packages you install globally. I can give you an example possible location in MacOS and you'll need to figure out the similar location in case you're in Windows. /usr/local/lib/node_modules/firebase-tools/lib/emulator/controller.js |
Thanks for your kind help, I able to find it. |
In case someone want to find global |
One line fix on OSX:
|
Combining both @micksatana and @lookfirst ideas together into the true one liner. sed -i '' 's/stopPort: port/stopPort: port+1/' $(npm root -g)/firebase-tools/lib/emulator/controller.js YMMV. |
@Hacksore Only if you've installed firebase-tools globally, which is something I personally try to avoid with npm packages. I'd rather go with any alias in my .bashrc file:
Or just always use The reason I avoid this is because this allows me to have different versions of dependencies in each project. If I decide I never want to use firebase again, I just remove the projects and I don't have to remember to remove anything globally. I also don't have version conflicts and strange behaviour this way. Yes, the cost is more disk space, but disk is cheap. |
Thanks everyone for the discussion. As we've noticed, this is caused by a breaking change in portfinder and now fixed by https://www.npmjs.com/package/portfinder/v/1.0.23 . If you're interested in how and why this broke us, see http-party/node-portfinder#89 A clean install / update like |
* Pin [email protected]. Fix #1606. * portfinder 1.0.23 should come with the fix. * Update package-lock.json.
We've also updated the dependency in v7.2.4 so if you install |
I wasted a couple hours trying to figure out what the problem was. How about pinning ALL (instead of the current 'some') of the versions in package.json so that future versions don't screw things up? Additionally, you should consider handling the error more gracefully (ie: a better error message and stack trace). |
I found that updating the global |
bug is fixed via a revert to portfinder (yesterday) - |
@Jank1310 I just did your suggestion and get :
have any idea? |
@akildemir
|
I just had this issue pop up after Mac OS upgrade Any ideas? |
@TomKaltz Would you mind opening a new issue? That helps us a lot when triaging. |
I found and killed the process with the help of this https://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac
Then I killed the PID with |
If you are facing this issue in macOS Pro then this solution is for you. In MacOS , Port 5000 may be claimed by a new "AirPlay Receiver". This can be disabled in Settings -> Sharing: I'm also adding the Screenshot of settings panel for disabling AirPlay Receiver. Disabling the AirPlay Receiver (if you do not need it) frees up port 5000. |
[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
The text was updated successfully, but these errors were encountered: