Shopify-cli migration npm run dev error

Topic summary

Developers are encountering an error when running npm run dev during a Shopify CLI migration.

The command appears to execute normally but fails at the end with:

  • Exit code 1 error
  • Message indicating “Unable to obtain an available random port number”

Multiple users report experiencing the same issue, with at least one confirming it occurs when running the shopify app dev command with the railway CLI. The problem remains unresolved with no solution posted yet.

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

when i run npm run dev, everything appears to work fine and at the end it says

Abort [Error]: Command failed with exit code 1: npm run --prefix ../.. dev
 error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Unable to obtain an available random port number!

has anybody else had this error?

1 Like

I am also having this error when I try to run shopify app dev command with railway cli.