cli: [Bug]: "spawn Unknown system error" when running "npm run dev" on new app

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

App

Expected behavior

Running npm run dev should start up a dev server to preview my app

Actual behavior

npm run dev throws an error

Verbose output

Error: Command failed with Unknown system error -86: /Users/kj/Code/_apps/sunday-scaries-checkout-ui/node_modules/@shopify/plugin-cloudflare/bin/cloudflared tunnel --url http://localhost:51733 --no-autoupdate
spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:757:9)
    at execa (file:///Users/kj/Code/_apps/sunday-scaries-checkout-ui/node_modules/execa/index.js:84:26)
    at buildExec (file:///Users/kj/Code/_apps/sunday-scaries-checkout-ui/node_modules/@shopify/cli-kit/dist/public/node/system.js:80:28)
    at exec (file:///Users/kj/Code/_apps/sunday-scaries-checkout-ui/node_modules/@shopify/cli-kit/dist/public/node/system.js:35:28)
    at file:///Users/kj/Code/_apps/sunday-scaries-checkout-ui/node_modules/@shopify/plugin-cloudflare/dist/tunnel.js:60:9
    at new Promise (<anonymous>)
    at tunnel (file:///Users/kj/Code/_apps/sunday-scaries-checkout-ui/node_modules/@shopify/plugin-cloudflare/dist/tunnel.js:30:12)
    at Object.hookStart [as action] (file:///Users/kj/Code/_apps/sunday-scaries-checkout-ui/node_modules/@shopify/plugin-cloudflare/dist/tunnel.js:15:31)
    at Object.<anonymous> (file:///Users/kj/Code/_apps/sunday-scaries-checkout-ui/node_modules/@shopify/cli-kit/dist/public/node/plugins/tunnel.js:16:24)

Reproduction steps

  1. Following Shopify’s tutorial on setting up a checkout ui extension. Run npm init @shopify/app@latest
  2. cd into app directory
  3. npm run shopify app generate extension
  4. Choose No, connect it to an existing app and select app.
  5. Select development store to preview app. The store has the checkout extensibility developer preview.
  6. Hit enter. Error is thrown.

Operating System

Mac OS Ventura 13.3.1

Shopify CLI version (check your project’s package.json if you’re not sure)

3.45.1

Shell

zsh

Node version (run node -v if you’re not sure)

v18.16.0

What language and version are you using in your application?

Node

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

I ran npm audit fix --force, and Shopify CLI was set back to v3.23.0. This version runs as expected and does not produce the original error.

@wisniewski94 can confirm installing rosetta via this single prompt fixed and npm run dev works as expected now, thanks 😃

In my opinion, you should check if you can run cloudflared service which is being spawned by CLI when you use cloudflare plugin. Here are the docs: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/local/#prerequisites

If you google -86 status code, you will find that it’s common to M1/M2 users and some report that rosetta helps to overcome the issue

softwareupdate --install-rosetta

Finding out if it works will help narrow down our bug hunting 😃