One*_*yte 6 javascript node.js firebase
我正在使用 Firebase 运行我的应用程序的后端。当我尝试使用 \n 运行后端时,firebase emulators:start --inspect-functions它说
节点 v: 18.13.0
\nFirebase-tools v: ^11.18.0
\nFirebase-functions v: ^4.2.0
i emulators: Starting emulators: auth, functions, storage\n\xe2\x9a\xa0 functions: You are running the Functions emulator in debug mode (port=9229). This means that functions will execute in sequence rather than in parallel.\n\xe2\x9a\xa0 functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: firestore, database, hosting, pubsub\n\xe2\x9a\xa0 functions: Unable to fetch project Admin SDK configuration, Admin SDK behavior in Cloud Functions emulator may be incorrect.\ni ui: Emulator UI logging to ui-debug.log\ni functions: Watching "/home/ktk/code/js/sol/functions/functions" for Cloud Functions...\n\xe2\x9a\xa0 functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.\n\xe2\x9c\x94 functions: Using node@18 from host.\n\xe2\xac\xa2 functions: Failed to load function definition from source: FirebaseError: Failed to load environment variables from .env.\nRun Code Online (Sandbox Code Playgroud)\n我检查过的事情:
\nchmod 777 .env以更改权限这里的问题可能是您正在为环境变量键使用保留的 Firebase 名称。您可以查看Firebase Config Env文档。
任何以 FIREBASE 一词开头的键都被保留。
我遇到了同样的问题,我可以通过更改环境变量的名称来解决它。
我希望这有帮助。祝你好运!:)
Kam*_*dev -2
任何原因都可能发生这种情况:
仔细检查该文件是否包含以下行:
FIREBASE_API_KEY=XYZ123
FIREBASE_AUTH_DOMAIN=mydomain.firebaseapp.com
FIREBASE_DATABASE_URL=https://mydatabase.firebaseio.com
etc...
Run Code Online (Sandbox Code Playgroud)
检查 .env 文件是否已在您的gitignore或.npmignore. 如果忽略该文件,则不会加载环境变量。并确保设置变量时 = 周围没有空格。
| 归档时间: |
|
| 查看次数: |
3664 次 |
| 最近记录: |