简体   繁体   中英

ECONNREFUSED Error when trying to run Firebase pubsub scheduled cloud function on shell

I am trying to run a pubsub.schedule function on Firebase emulator. I tried to follow the instructions in the following links.

https://github.com/firebase/firebase-tools/issues/1748#issuecomment-609735979

https://firebase.google.com/docs/functions/local-shell#set_up_admin_credentials_optional

I keep getting the error below when I run firebase functions:shell .

Error: Server Error. connect ECONNREFUSED 127.0.0.1:4400

Any idea how to solve it? Thank you.

In my case, this was caused by Microsoft Defender, it may be any other firewall block. Try running "firebase emulators:start" in the same cmd window, if you get a message from MS Defender, click "Allow". Then you can stop the emulators and run "firebase functions:shell" in the same cmd window, it should work properly.

In my case, after running "firebase emulators:start" everything worked. It appeared that the command installed a few.jar files and perhaps that was the reason.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM