Running npm run dev and getting Error forwarding web request in my terminal

Shopify Partner
1 0 0

After following the shopify create an app documentation, whenever i run 'npm run dev' i keep getting 'Error forwarding web request: Error: connect ECONNREFUSED' when i try to open the installed app in my store.

Reply 1 (1)

Shopify Staff
2731 298 769

Hi CipherB,


This Error forwarding web request error usually happens when the development server isn't running or isn't accessible. Here are a few things you can try to fix the issue:

  1. Check if your development server is running: The error message implies that nothing is listening on port 40021. Make sure that your development server is running and is set to listen on the correct port.

  2. Check your firewall settings: Your firewall might be blocking the connection to the server. You can try to temporarily disable your firewall and see if the error persists.

  3. Try a different port: The port you're using might be already in use by another service. Try changing the port for your development server.

  4. Check your network connection: Make sure that your computer is correctly connected to the network.

  5. Reinstall dependencies: There might be an issue with your project's dependencies. Try deleting your node_modules directory and your package-lock.json file, and then run npm install again.

If none of these steps solve the issue, please provide more information about your setup, and we can dive into this issue further. Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog