Cannot skip browser login with SHOPIFY_CLI_DEVICE_AUTH=1

Topic summary

A developer is unable to authenticate Shopify CLI on a remote Ubuntu 20.04 server without a browser.

Previous workaround no longer works:

  • The environment variable SHOPIFY_CLI_ACCESS_CODE_AUTH=1 previously allowed login without a browser
  • After updating to the latest CLI version, this method stopped functioning

Current behavior:

  • CLI prompts to press any key to open a browser login page
  • Pressing any key triggers an error: Error: spawn xdg-open ENOENT
  • The error originates from Node.js child process attempting to launch a browser that doesnโ€™t exist

Status:

  • User filed a GitHub issue (#4945) last Friday
  • No response or solution has been provided yet
  • The issue remains unresolved, blocking CLI usage on headless/remote environments
Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

I install the CLI in my remote Ubuntu 20.04 dev server. There is no browser to login the CLI. Previously, I can use the option SHOPIFY_CLI_ACCESS_CODE_AUTH=1 npm run dev to login without problem.

When I use the latest CLI, I cannot login anymore. The CLI asks me to press any key and then gives an error:

bennychan:~/abc$ SHOPIFY_CLI_ACCESS_CODE_AUTH=1 npm run dev โ€“ --theme 1234

dev> shopify app dev --theme 1234

To run this command, log in to Shopify.
:backhand_index_pointing_right: Press any key to open the login page on your browser

When I press any key, it gives this error:

Error: spawn xdg-open ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

How can I fix this issue? Any one has the same issue. I donโ€™t understand why the CLI asks me to login suddenly and the option is not working.

Iโ€™ve also posted an issue on Github on last Friday. But there is no reply yet.

1 Like