“exp:找不到命令"如何将 expo cli 添加到路径? [英] "exp: command not found" How do I add expo cli to path?

查看:14
本文介绍了“exp:找不到命令"如何将 expo cli 添加到路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用

npm i -g exp

然后我运行

exp

我得到了

-bash: exp: command not found

我猜我没有将 exp 添加到路径中.那么我该如何正确地做到这一点呢?到目前为止,我尝试过的任何方法都不起作用.

I'm guessing I didn't add exp to path. So how do I do this properly? Nothing I've tried so far works.

推荐答案

这个建议的 3 步解决方案对我有用:

This suggested 3 steps solution worked for me:

  1. 首先检查 ~/.npm-global/bin 是否在您的路径中:echo $PATH.如果不存在,则需要将其添加到路径中.

  1. First check if ~/.npm-global/bin is in your path: echo $PATH. If it isn’t there, you will need to add it to the path.

打开 ~/.bash_profile 然后将以下行添加到底部:export PATH=$PATH:~/.npm-global/bin

Open up ~/.bash_profile then add the following line to the bottom: export PATH=$PATH:~/.npm-global/bin

最后,回到 shell,输入:source ~/.bash_profile

Finally, back in the shell, type: source ~/.bash_profile

希望这能解决您的问题.

Hopefully that will have fixed your problem.

这篇关于“exp:找不到命令"如何将 expo cli 添加到路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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