未找到 ngrok 命令 [英] ngrok command not found

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

问题描述

我正在尝试在我 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.

  1. 从这里下载 ngrok https://ngrok.com/download.

解压文件并将 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 操作系统)会在您的 中指定的文件夹中查找这些程序路径.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屋!

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