FirebaseError:无法从.env加载环境变量

编程入门 行业动态 更新时间:2024-09-25 18:19:44

FirebaseError:无法从.env加载<a href=https://www.elefans.com/category/jswz/34/1770788.html style=环境变量"/>

FirebaseError:无法从.env加载环境变量

我正在使用 Firebase 运行我的应用程序的后端。当我尝试使用运行后端时

firebase emulators:start --inspect-functions
它说

节点v:18.13.0
Firebase 工具 v:^11.18.0
Firebase 函数 v:^4.2.0

i  emulators: Starting emulators: auth, functions, storage
⚠  functions: You are running the Functions emulator in debug mode (port=9229). This means that functions will execute in sequence rather than in parallel.
⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: firestore, database, hosting, pubsub
⚠  functions: Unable to fetch project Admin SDK configuration, Admin SDK behavior in Cloud Functions emulator may be incorrect.
i  ui: Emulator UI logging to ui-debug.log
i  functions: Watching "/home/ktk/code/js/sol/functions/functions" for Cloud Functions...
⚠  functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.
✔  functions: Using node@18 from host.
⬢  functions: Failed to load function definition from source: FirebaseError: Failed to load environment variables from .env.

我检查过的事情:

  • .env 确实存在
  • .env 语法正确
  • 执行
    chmod 777 .env
    更改权限
回答如下:

这里的问题可能是您正在为环境变量键使用保留的 Firebase 名称。您可以查看 Firebase Config Env 文档。

任何以 FIREBASE 一词开头的键都被保留。

我遇到了同样的问题,我可以通过更改环境变量的名称来解决它。

我希望有帮助。祝你好运! :)

更多推荐

FirebaseError:无法从.env加载环境变量

本文发布于:2024-06-16 01:02:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1771433.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:环境变量   加载   FirebaseError   env

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!