我正在学习 firebase 来与我的 React Web 应用程序集成。我试图为 GET 和 POST 请求编写函数,并使用我在 vscode 中的终端中获得的端点在邮递员上运行它们。\n现在我的代码与 firebase 部署完美配合,但在我尝试使用 firebase 服务时出现错误。另外,我不能简单地使用这些命令,我必须使用 sudo 运行它们,然后输入我的密码,只有这样我才能运行它们。\n下面是错误列表
\n\n\nCloud Firestore 模拟器未运行,因此对 Firestore 的调用将影响生产。
\n\n\xe2\x9a\xa0 请求外部网络资源!\n - URL: " http://169.254.169.254/computeMetadata/v1/instance "\n - 请小心,这可能是生产服务。
\n\n\xe2\x9a\xa0 请求外部网络资源!\n - URL:“ http://metadata.google.internal./computeMetadata/v1/instance ”\n - 请小心,这可能是生产服务。
\n\n错误:无法加载默认凭据。浏览至https://cloud.google.com/docs/authentication/getting-started了解更多信息。
\n\nRun Code Online (Sandbox Code Playgroud)\n\nat GoogleAuth.getApplicationDefaultAsync (/home/nikunj/socialape-functions/functions/node_modules/google-auth-library/build/src/auth/googleauth.js:160:19)\n\n at processTicksAndRejections (internal/process/task_queues.js:97:5)\n\n at async GoogleAuth.getClient (/home/nikunj/socialape-functions/functions/node_modules/google-auth-library/build/src/auth/googleauth.js:502:17)\n\n at async GrpcClient._getCredentials (/home/nikunj/socialape-functions/functions/node_modules/google-gax/build/src/grpc.js:92:24)\n\n at async GrpcClient.createStub (/home/nikunj/socialape-functions/functions/node_modules/google-gax/build/src/grpc.js:213:23)\n原因:错误
\n\nRun Code Online (Sandbox Code Playgroud)at WriteBatch.commit (/home/nikunj/socialape-functions/functions/node_modules/@google-cloud/firestore/build/src/write-batch.js:415:23)\n\n at DocumentReference.create (/home/nikunj/socialape-functions/functions/node_modules/@google-cloud/firestore/build/src/reference.js:283:14)\n at CollectionReference.add (/home/nikunj/socialape-functions/functions/node_modules/@google-cloud/firestore/build/src/reference.js:2011:28)\n at …
node.js firebase reactjs firebase-tools google-cloud-firestore