找不到ngrok命令 [英] ngrok command not found
问题描述
我正在尝试在1周大的优胜美地上安装ngrok
(在Windows上已经使用了一段时间,没有任何问题),这是我到目前为止所遵循的步骤.
I'm trying to install ngrok
(which I've been using for a while on Windows with no issues) on my 1 week old yosemite and these are the steps I've followed so far.
-
从此处 https://ngrok.com/download 下载ngrok.
解压缩文件并将Unix可执行文件复制到 应用程序.
Unziped the file and copied the Unix Executable File into application.
现在,据我了解,我只需要打开终端,在应用程序文件夹内移动并编写ngrok http 80
.结果是找不到命令".
Now from what I understand I just need to open the terminal, move inside the application folder and write ngrok http 80
. The result of this is "command not found".
我什至已经在ngrok
网站上注册并从终端运行命令./ngrok authtoken "blablabla"
,结果是没有这样的文件或目录"
I've even signed up at the ngrok
website and run from terminal the command ./ngrok authtoken "blablabla"
and the result is "No such file or directory"
有人可以告诉我如何继续使用ngrok
激活隧道吗?
Can anyone tell me how to proceed to be able to activate the tunnel with ngrok
?
推荐答案
简短答案:将可执行文件放置在/usr/local/bin
中,而不是应用程序中.现在,您应该能够运行ngrok http 80
之类的命令.
Short answer: Put the executable file in /usr/local/bin
instead of applications. You should now be able to run commands like ngrok http 80
.
长答案:当您在终端中键入ngrok
之类的命令时,Mac(和其他Unix OS)会在PATH
中指定的文件夹中查找这些程序. PATH
是每个用户指定的文件夹列表.要检查路径,请打开终端并输入:echo $PATH
.
Long answer: When you type commands like ngrok
in the terminal, Macs (and other Unix OSs) look for these programs in the folders specified in your PATH
. The PATH
is a list of folders that's specified by each user. To check your path, open the terminal and type: echo $PATH
.
您将看到类似于以下内容的输出:/usr/local/bin:/usr/bin:/bin
.这是:
分隔的文件夹列表.
You'll see output that looks something like: /usr/local/bin:/usr/bin:/bin
. This is a :
separated list of folders.
因此,当您在终端中键入ngrok
时,Mac将在以下文件夹中寻找此可执行文件:/usr/local/bin
,/usr/bin/
和/bin
.
So when you type ngrok
in the terminal, your Mac will look for this executable in the following folders: /usr/local/bin
, /usr/bin/
and /bin
.
如果您有兴趣,请阅读这篇文章了解为什么为什么应该优先使用usr/local/bin
而不是其他文件夹.
Read this post if you are interested in learning about why you should prefer usr/local/bin
over other folders.
这篇关于找不到ngrok命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!