Why am I getting the 'Ngrok tunnel could not be started' error in Node.js?

I have creating the Shopify application from learning this website https://shopify.dev/apps/getting-started/create#step-1-create-a-new-app while I have following the steps and I have completed Step 1: Create a new app. Unfortunately, I have been stucked in Step 2: Start a local development server owing to I am coding in the node js even I am getting The Ngrok tunnel could not be started error. So kindly solve the issue.

Thank you

4 Likes

Hi, I had faced exact same issue. This is how I had resolved such kind of ngrok start failed issue in my shopify node app. Follow these steps to resolve issue.

  1. npm run shopify ngrok auth [TOKEN]
  2. rm -rf node_modules
  3. rm package-lock.json
  4. npm i
  5. npm run dev (i.e. start script)

Note: Please correct me if I am wrong. Suggestions and feedback are welcome.

didn’t work for me

Hi,

I had the same issue on a Macbook.

What worked for me was copying the ngrok.exe file into /user/local/bin and then going through the steps @lekh mentioned

Running into the same error as this. Running MacOS Ventura 13.2.1. Tried scaffolding a new application and I am getting the same exact “Ngrok tunnel could not be started”.

- I’ve tried scaffolding using pnpm, yarn, and npm, this had no effect

  • I’ve tried using different networks

  • I’ve tried symlinking the homebrew binary for ngrok to /usr/local/bin/ngrok (sudo \ln -s $(which ngrok) /usr/local/bin/ngrok)

  • I’ve tried using multiple different stores

  • I’ve tested ngrok manually, and I can open a tunnel manually

What is going on here? The amount of time I’ve spent making no progress while developing embedded apps is too damn high.

Thanks for sharing, I just typed the first command and the issue is fixed.

I found the solution today. I used cloudfare. Follow below steps:

Step 1: Run “cloudflared tunnel --url http://localhost:3000”.

Step 2: One URL will be generated in the CMD for example “https://example.trycloudflare.com”. Copy that and use it in Step 3.

Step 3: sudo npm run dev – --tunnel-url https://example.trycloudflare.com:3000.

Hope it helps. Cheers :slightly_smiling_face:

1 Like