英文:
Android Terminal does not recognise firebase command
问题
我有一个奇怪的情况,我无法在Android Studio中运行firebase
命令。我可以在终端中运行这些命令,但不能在Android Studio内部的终端中运行。
举个例子,如果我在终端中运行firebase login
,我可以登录,但如果在Android Studio中运行它,我会得到这个错误:zsh: command not found: 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.
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论