Android终端无法识别firebase命令。

huangapple go评论124阅读模式
英文:

Android Terminal does not recognise firebase command

问题

我有一个奇怪的情况,我无法在Android Studio中运行firebase命令。我可以在终端中运行这些命令,但不能在Android Studio内部的终端中运行。

举个例子,如果我在终端中运行firebase login,我可以登录,但如果在Android Studio中运行它,我会得到这个错误:zsh: command not found: firebase

请查看下面的图像以证明这种情况。

Android终端无法识别firebase命令。

我尝试运行以下命令,并在终端中得到以下结果:

MyMac:my_folder myuser$ which firebase
/Users/myuser/.nvm/versions/node/v17.0.1/bin/firebase
MyMac:my_folder myuser$ readlink $(which firebase)
../lib/node_modules/firebase-tools/lib/bin/firebase.js

如果我在Android中执行相同的操作,什么都不会得到。我怀疑这是因为Android Studio找不到firebase文件的正确路径?

有任何帮助吗?

我使用的是macOS Ventura,使用的是Android Studio Electric Eel。

非常感谢!

英文:

I have this weird situation where I am not able to run firebase commands from android studio. I can run such commands in terminal but not in the terminal inside android studio.

As an example if I run firebase login in terminal, I can login but if run it in android studio I get this error: zsh: command not found: firebase.

See below an image to prove this case.

Android终端无法识别firebase命令。

I tried to run the following command and got the following in terminal

MyMac:my_folder myuser$ which firebase
/Users/myuser/.nvm/versions/node/v17.0.1/bin/firebase
MyMac:my_folder myuser$ readlink $(which firebase)
../lib/node_modules/firebase-tools/lib/bin/firebase.js

If I do the same in Android I get nothing. I suspect it is a matter of Android studio not finding the right path to the firebase files?

Any help?

I am on a macOS Ventura and using Android Studio Electric Eel

Thanks so much!!

答案1

得分: 1

我建议您检查环境中的PATH变量,分别查看nodejs和firebase工具。

如果您已将firebase-cli全局安装,
我建议您查看nodejs和firebase工具的环境PATH变量。

如果您已将其作为依赖项本地安装,
在这里是在macOS上安装firebase-cli的安装指南。

无论如何,我建议您在再次运行终端之前使Android Studio的缓存无效并重新启动。

英文:

How did you install firebase tools (locally or globally)?

if you have globally installed firebase-cli,
I suggest you to look into environment PATH variables for both nodejs and firebase tools.

if you have installed locally as a dependancy,
here is a installation guide to install firebase-cli on macOS.

Eitherway, I suggest you to Invalidate cache and restart your Android studio before running the terminal again.

huangapple
  • 本文由 发表于 2023年2月16日 17:28:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75470210.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定