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

Murali_Ramanath
Shopify Partner
2 0 5

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

Replies 6 (6)

lekh
Visitor
1 0 0

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.

LakshayLakshay
Shopify Partner
11 0 0

didn't work for me 

 

L Kalra
amJayem
Shopify Partner
1 0 0

error.png

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

joelmasters
Shopify Partner
1 0 0

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

jasonraimondi
Shopify Partner
1 0 0

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.

Girish_Rajwani
Shopify Partner
82 3 8

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 🙂

Girish | Shopify Expert  
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - My Shopify Apps: App Store | Looking for a solution to a problem in your store? Send me an email