ngrok command not found

2019-03-08 13:01发布

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. Downloaded ngrok from here https://ngrok.com/download.

  2. Unziped the file and copied the Unix Executable File into application.

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".

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"

Can anyone tell me how to proceed to be able to activate the tunnel with ngrok?

10条回答
祖国的老花朵
2楼-- · 2019-03-08 13:15

For installation in Windows : Download and extract to any directory (lets say c drive)

  • Then double click on the extracted ngrok.exe file and you'll be able to see the command prompt.

  • And just type ngrok http 4040 // here I am exposing [port 4040]

查看更多
▲ chillily
3楼-- · 2019-03-08 13:16

With Homebrew already installed on your Mac, you can easily install ngrok from the terminal, using this command:

$ brew cask install ngrok

Then run it from the shell using this command:

$ ngrok http 8000

With this command, you're telling ngrok to basically create a tunnel to your localhost 8000 and assign an internet name host for it. And thats it. You should be good to go.

查看更多
Evening l夕情丶
4楼-- · 2019-03-08 13:16

just download it , unzip it run

./ngrok http 80
查看更多
Deceive 欺骗
5楼-- · 2019-03-08 13:20

On Windows 10, for me

ngrok http 80

behaves like this:

  • works from Command Prompt (cmd.exe)
  • does not work from Git Bash
  • does not work from Windows PowerShell
查看更多
再贱就再见
6楼-- · 2019-03-08 13:21

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.

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.

You'll see output that looks something like: /usr/local/bin:/usr/bin:/bin. This is a : separated list of folders.

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.

Read this post if you are interested in learning about why you should prefer usr/local/bin over other folders.

查看更多
成全新的幸福
7楼-- · 2019-03-08 13:25

This is how I got it to work..

For Mac

  1. If you downloaded via a download link, you need to add ngrok path to your .bash_profile or .bashrc whichever one you are using.

For Windows 10 bash:

  1. Download ngrok from https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip
  2. Move executable file ngrok.exe to C:\Windows\system32\ngrok.exe
  3. Add Environment Variables via UI (search for "Edit the environment variables for your account" in the search bar next to windows logo => double click on Path under Users Variables for yourusername => Click New => add your path C:\Windows\system32\ngrok.exe => click OK.
  4. Restart your bash and you should be able to run "ngrok http 80" command.
查看更多
登录 后发表回答