【问题标题】:Can't test Firebase Cloud Functions locally on Windows: 'Error: listen EACCES'无法在 Windows 上本地测试 Firebase Cloud Functions:“错误:监听 EACCES”
【发布时间】:2019-10-02 17:32:48
【问题描述】:

我无法在 Windows 10 上本地运行 firebase 云功能。

重现此问题:只需使用 firebase init 和 init 函数初始化一个新的 firebase 项目。 这是一个带有示例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!");
});

这是我运行时得到的输出: firebase serve --only functions,然后在浏览器中转到http://localhost:5000/cloudfunctionsfireship/us-central1/helloWorld

+  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>)

【问题讨论】:

    标签: firebase google-cloud-functions firebase-admin firebase-tools


    【解决方案1】:

    Firebase CLI 模拟器中存在错误。请关注 GitHub here 上的问题。将来,请将错误报告发送到该 GitHub 存储库而不是 Stack Overflow。

    【讨论】:

    • 感谢您的回复,我会检查一下,但这与我得到的错误不同。我没有收到该权限被拒绝的消息。我认为这是不同的。
    猜你喜欢
    • 2018-11-21
    • 2021-11-30
    • 1970-01-01
    • 2014-07-12
    • 2014-01-25
    • 2019-05-10
    • 1970-01-01
    相关资源
    最近更新 更多