小编Dan*_*Neo的帖子

firebase-tools getaddrinfo ENOTFOUND metadata.google.internal

我在终端中收到此错误:

@firebase/database: FIREBASE WARNING: {"code":"app/invalid- 
credential","message":"Credential implementation provided to . 
initializeApp() via the \"credential\" property failed to fetch a valid 
Google OAuth2 access token with the following error: \"Failed to parse 
access token response: Error: Error while making request: getaddrinfo 
ENOTFOUND metadata.google.internal metadata.google.internal:80. Error 
code: ENOTFOUND\"."}`
Run Code Online (Sandbox Code Playgroud)

使用时firebase-tools。这是我要运行的简单节点脚本。

const admin = require("firebase-admin");

const firebase = admin.initializeApp({
  apiKey: "MY_API_KEY",
  authDomain: "APP_ID.firebaseapp.com",
  databaseURL: `https://DATABASE_URL.firebaseio.com`,
  projectId: "APP_ID"
});

const snap = firebase
  .database()
  .ref("REF")
  .child("ID")
  .once("value");
console.log(snap);
Run Code Online (Sandbox Code Playgroud)

Firebase工具版本:5.0.1

我已经试过卸载并重新安装,进出的火力点,用工具登录firebase login/ …

javascript node.js firebase firebase-admin

4
推荐指数
1
解决办法
1984
查看次数

标签 统计

firebase ×1

firebase-admin ×1

javascript ×1

node.js ×1