0

I can't run firebase cloud functions locally on Windows 10.

To reproduce this issue: Just init a new firebase project with firebase init and init functions. This is a test with the example helloWorld

import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';

admin.initializeApp();

// Start writing Firebase Functions
// https://firebase.google.com/docs/functions/typescript

export const helloWorld = functions.https.onRequest((request, response) => {
 response.send("Hello from Firebase!");
});

This is the output I get when I run: firebase serve --only functions and then go to http://localhost:5000/cloudfunctionsfireship/us-central1/helloWorld in the browser.

+  functions: Using node@8 from host.
+  functions: Emulator started at http://localhost:5000
i  functions: Watching "C:\Users\algar\Alvaro\Develop\Test\Cloud Functions\example1\functions" for Cloud Functions...
!  Default "firebase-admin" instance created!
i  functions: HTTP trigger initialized at http://localhost:5000/cloudfunctionsfireship/us-central1/helloWorld
i  functions: Beginning execution of "helloWorld"
!  Default "firebase-admin" instance created!
>  events.js:183
>        throw er; // Unhandled 'error' event
>        ^
> 
>  Error: listen EACCES C:\Users\algar\AppData\Local\Temp\firebase_emulator_invocation_10624.sock
>      at Server.setupListenHandle [as _listen2] (net.js:1343:19)
>      at listenInCluster (net.js:1401:12)
>      at Server.listen (net.js:1496:5)
>      at Function.listen (C:\Users\algar\AppData\Roaming\nvm\v8.16.0\node_modules\firebase-tools\node_modules\express\lib\application.js:618:24)
>      at Promise (C:\Users\algar\AppData\Roaming\nvm\v8.16.0\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:359:46)
>      at new Promise (<anonymous>)
>      at C:\Users\algar\AppData\Roaming\nvm\v8.16.0\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:332:15
>      at Generator.next (<anonymous>)
>      at C:\Users\algar\AppData\Roaming\nvm\v8.16.0\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:7:71
>      at new Promise (<anonymous>)
Alvaro
  • 95
  • 1
  • 8

1 Answers1

0

There is a bug in the Firebase CLI emulator. Please follow the issue on GitHub here. In the future, please send bug reports to that GitHub repo rather than Stack Overflow.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • Thanks for your reply, I will check that but It's not the same error that I get. I don't get that permission denied message. I think that is something different. – Alvaro May 17 '19 at 07:26