Running dev app with --tunnel-url flag throws command not found error

Topic summary

A developer encountered a “command not found” error when attempting to run a Shopify app dev server with a Cloudflare tunnel using the --tunnel-url flag.

Issue:

  • Running sudo npm run dev --tunnel-url https://<tunnel-url>:<port> resulted in error: command app:dev:https://<tunnel-url>:<port> not found
  • Environment: Shopify CLI version 3.21.0, with dependencies at 3.22.1
  • Version mismatch persisted even after upgrade attempts

Resolution:
The developer self-resolved by identifying the correct syntax requires adding -- before the flag:

sudo npm run dev -- --tunnel-url https://<tunnel-url>:<port>

Additional Note:
The developer suggests that both Shopify’s documentation and app template README need updating to reflect the correct command syntax.

Summarized with AI on November 25. AI used: claude-sonnet-4-5-20250929.

I am trying to run a dev server using a cloudflare tunnel.

I Ran this command according to the documentation (Note: I’ve replaced my actual url with :)

sudo npm run dev --tunnel-url https://<tunnel url>:<port>

But it returns

command app:dev:https://<tunnel url>:<port> not found 

Environment Info

Shopify CLI version

node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ shopify version
Current Shopify CLI version: 3.21.0

package.json

node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ cat package.json 
{
  "name": "shopify-saleschannel",
  "version": "1.0.0",
  "main": "web/index.js",
  "license": "UNLICENSED",
  "scripts": {
    "shopify": "shopify",
    "build": "shopify app build",
    "dev": "shopify app dev",
    "info": "shopify app info",
    "generate": "shopify app generate",
    "deploy": "shopify app deploy"
  },
  "dependencies": {
    "@shopify/app": "3.22.1",
    "@shopify/cli": "3.22.1"
  },
  "author": "node"

Oddly, shopify version reported does no match my dependencies (even after upgrading)

node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ shopify version
Current Shopify CLI version: 3.21.0
? Version 3.22.1 available!
node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ shopify upgrade
Upgrading CLI from 3.21.0 to 3.22.1...
Executing... npm install @shopify/cli@latest @shopify/app@latest --save-prod
up to date, audited 560 packages in 925ms

115 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
✅ Success! Upgraded Shopify CLI to version 3.22.1.
node ➜ /workspaces/shopify-devkit/shopify-saleschannel (main ✗) $ shopify version
Current Shopify CLI version: 3.21.0
? Version 3.22.1 available

and Shopify logs analytics event data if useful

2052 [2022-11-09T06:37:47.230Z 6e0e145e-037e-4b91-b7fa-89e54a6ebb2e DEBUG]: Analytics event sent: {
2053 "command": "logs",
2054 "time_start": 1667975653969,
2055 "time_end": 1667975866334,
2056 "total_time": 212365,
2057 "success": true,
2058 "cli_version": "3.21.0",
2059 "ruby_version": "2.7.4",
2060 "node_version": "16.18.0",
2061 "is_employee": false,
2062 "uname": "linux amd64",
2063 "env_ci": false,
2064 "env_plugin_installed_any_custom": false,
2065 "env_plugin_installed_shopify": "[\"@shopify/cli\",\"@shopify/plugin-ngrok\",\"@shopify/theme\"]",
2066 "env_shell": "bash",
...
2068 "env_cloud": "localhost",
2069 "env_package_manager": "npm",
2070 "cmd_all_launcher": "unknown",
2071 "cmd_all_plugin": "@shopify/cli",
2072 "cmd_all_path_override": false,
2073 "args": "",
2074 "env_plugin_installed_all": "[\"@shopify/cli\",\"@shopify/plugin-ngrok\",\"@shopify/theme\"]",
2075 "metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"

The correct command to use is this (notice the addition --)

sudo npm run dev -- --tunnel-url https://<tunnel url>:<port>

The Documentation and shopify template app README.md needs to be updated.

3 Likes