成功使用Firebase命令几天后未找到它 [英] Firebase command not found days after having already successfully used it

查看:111
本文介绍了成功使用Firebase命令几天后未找到它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Mac终端使用'firebase'命令通过'firebase deploy --only functions'部署firebase云功能.一两个星期前,当我将firebase-functions和firebase-tools更新到版本3.18.4时,我才使用此命令,但是现在每次我尝试使用'firebase'关键字运行命令时,该命令都会显示 -bash:firebase:找不到命令.当我运行 npm -g list 时,我看到该列表中有firebase,firebase-tools等.

I am trying to use the 'firebase' command from my Mac terminal to deploy firebase cloud functions using 'firebase deploy --only functions'. I just used this command a week or two ago when I updated my firebase-functions and firebase-tools to version 3.18.4 but now everytime I try to use the 'firebase' keyword to run a command it says -bash: firebase: command not found. When I run npm -g list I see that I have firebase, firebase-tools and more in that list.

我已经尝试运行'npm install -g firebase-tools`,但是它仍然无法正常工作.我也尝试了此问题中的建议

I've tried running 'npm install -g firebase-tools` but it still doesn't work. Also I tried what is recommended in this question

但仍然无法正常工作.任何建议都很好,谢谢

but still not working. Any advice would be great, thanks

推荐答案

首先我运行了 npm获取前缀,它应该输出类似/Users/username/.npm-packages .然后我必须将以下内容添加到我的$ PATH变量中

First I ran npm get prefix which should output something like /Users/username/.npm-packages. Then I had to add the following to my $PATH variable

export PATH ="/Users/username/.npm-packages/bin:$ PATH" 注意额外的/bin (在npm的结果得到前缀之后)

export PATH="/Users/username/.npm-packages/bin:$PATH" Note the extra /bin (after the result of npm get prefix)

我还添加了 export PATH ="/usr/local/share/npm/bin:/usr/local/bin:/usr/local/sbin:〜/bin:$ PATH $

然后,您必须通过运行 source〜/.bash_profile

Then you must activate the changes to your bash_profile by running source ~/.bash_profile

一旦执行此操作,firebase命令将再次被全局识别

Once I did this the firebase command is again globally recognized

这篇关于成功使用Firebase命令几天后未找到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆