Authentication requires a port 3456 that's unavailable because it's running another process

I am trying learn shopify development and creating a first app. Upon doing the initial npm run dev, I am thrown an error stating “Authentication requires a port 3456 that’s unavailable because it’s running another process. Terminate that process?

If I choose to kill the process, it again throws the error stating “missing argument”.

Unknown error                                                                                           │
│                                                                                                          │
│  To investigate the issue, examine this stack trace:                                                     │
│    at handler (@shopify/cli-kit/src/public/node/error.ts:127)                                            │
│      fatal = new BugError(maybeError?.message ?? 'Unknown error')                                        │
│    at (@shopify/cli-kit/src/public/node/error-handler.ts:37)                                             │
│      return handler(error)           

I checked several times to see which app/process is blocking the port but nothing comes up.

I am using openSUSE Linux for the development.

Any pointers would be greatly appreciated.

Your computer might have another node app running on port 3456. You can use the following command to kill it and then npm run dev again.

sudo killall node

yeah, I tried doing that but it didn’t work. After a lot of tinkering I ran the command with sudo and surprisingly it started to work; didn’t get any notification for port blocked, etc.

I have no clue why does it need elevated privileges.

sudo npm run dev

Confirming this is still an issue (in openSuse tumbleweed) and fix still works

I’m having the same issue, on openSUSE Linux, Shopify CLI 3.61.2

Instead of running “shopify app dev” prefix it with HOST eg.

HOST=127.0.0.1 shopify app dev

Why?

Because Shopify CLI uses https://www.npmjs.com/package/get-port-please, which by default checks port on HOST env variable. On my OpenSuse HOST env var is set to “linux…”, and checking any port on “linux…” HOST fails.