cli: [Bug]: shopify theme dev error: reason: connect ETIMEDOUT 185.146.173.20:443

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?

Theme

Expected behavior

After logging in, i can develop on localhost

Actual behavior

request to https://accounts.shopify.com/oauth/token?grant_type=authorizati │ │ on_code&code=S3ZsTUZjVzhDSjNrV3JOMWRUbHNzUjEyNVF0V3hVUXVLNk1ua0VwOVFJTThvO │ │ CtOcUZOK3hoNktHQmFoTE9VNC9Nc29ocmladmVrWkJQUWhlZXpwZkIvclFzU3ErUTB5bWQ2N3o │ │ wem9GN2U0bkJxbkdFVW5wem10Z2FWK3YxRGFWRmJCS3N3MEZrZzYzYmY4YWM1WEl4K3lrL0FwS │ │ mQwMkREbzAyeUc4aU9KcHpjVG5mblF0NG10VzVIV2hESitlSjhrcCtITlZwL0w3aXFiOUFjN0N │ │ IVnJFRk5PQkhsa1dCcnpGL2VFUGhKdEg0aDh4eWFuTWlWeUcyejNjU1lRbTBhcGhFNjF1V1FGV │ │ jlaMXU0MnJwbC9nNmp1c3Fna1NaaUdScW1KMGtMZTdsaTYrbVlVZ05vcjBKU3BaN28vTHg3RWV │ │ QUHNyei0tZGk1U2szUXUwZEVWZ3BQcS0tWUdNVVpRbjBaRTl5cWlNdHJYOGRrUT09&redirect │ │ _uri=http%3A%2F%2F127.0.0.1%3A3456&client_id=fbdb2649-e327-4907-8f67-908d2 │ │ 4cfd7e3&code_verifier=8xGy6S_DTsetmuik8L6KBGBQEL_EMB55Ea5pT9vuKlk failed, │ │ reason: connect ETIMEDOUT 185.146.173.20:443

Verbose output

npm verb cli D:\Program Files\nodejs\node.exe d:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
npm info using npm@9.7.2
npm info using node@v16.20.1
npm verb title npm
npm verb argv "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:C:\Users\86187\AppData\Local\npm-cache\_logs\2023-06-26T01_59_06_167Z-
npm verb logfile C:\Users\86187\AppData\Local\npm-cache\_logs\2023-06-26T01_59_06_167Z-debug-0.log
npm <command>

Usage:

npm install        install all the dependencies in your project
npm install <foo>  add the <foo> dependency to your project
npm test           run this project's tests
npm run <foo>      run the script named <foo>
npm <command> -h   quick help on <command>
npm -l             display usage info for all commands
npm help <term>    search for help on <term> (in a browser)
npm help npm       more involved overview (in a browser)

All commands:

    access, adduser, audit, bugs, cache, ci, completion,
    config, dedupe, deprecate, diff, dist-tag, docs, doctor,
    edit, exec, explain, explore, find-dupes, fund, get, help,
    help-search, hook, init, install, install-ci-test,
    install-test, link, ll, login, logout, ls, org, outdated,
    owner, pack, ping, pkg, prefix, profile, prune, publish,
    query, rebuild, repo, restart, root, run-script, search,
    set, shrinkwrap, star, stars, start, stop, team, test,
    token, uninstall, unpublish, unstar, update, version, view,
    whoami

Specify configs in the ini-formatted file:
    C:\Users\86187\.npmrc
or on the command line via: npm <command> --key=value

More configuration info: npm help config
Configuration fields: npm help 7 config

npm@9.7.2 d:\nvm\v16.20.1\node_modules\npm
npm verb exit 1
npm verb code 1

Reproduction steps

1.shopify theme dev 2.Press any key to open the login page on your browser 3.request to https://accounts.shopify.com/oauth/token?grant_type=authorizati │ │ on_code&code=S3ZsTUZjVzhDSjNrV3JOMWRUbHNzUjEyNVF0V3hVUXVLNk1ua0VwOVFJTThvO │ │ CtOcUZOK3hoNktHQmFoTE9VNC9Nc29ocmladmVrWkJQUWhlZXpwZkIvclFzU3ErUTB5bWQ2N3o │ │ wem9GN2U0bkJxbkdFVW5wem10Z2FWK3YxRGFWRmJCS3N3MEZrZzYzYmY4YWM1WEl4K3lrL0FwS │ │ mQwMkREbzAyeUc4aU9KcHpjVG5mblF0NG10VzVIV2hESitlSjhrcCtITlZwL0w3aXFiOUFjN0N │ │ IVnJFRk5PQkhsa1dCcnpGL2VFUGhKdEg0aDh4eWFuTWlWeUcyejNjU1lRbTBhcGhFNjF1V1FGV │ │ jlaMXU0MnJwbC9nNmp1c3Fna1NaaUdScW1KMGtMZTdsaTYrbVlVZ05vcjBKU3BaN28vTHg3RWV │ │ QUHNyei0tZGk1U2szUXUwZEVWZ3BQcS0tWUdNVVpRbjBaRTl5cWlNdHJYOGRrUT09&redirect │ │ _uri=http%3A%2F%2F127.0.0.1%3A3456&client_id=fbdb2649-e327-4907-8f67-908d2 │ │ 4cfd7e3&code_verifier=8xGy6S_DTsetmuik8L6KBGBQEL_EMB55Ea5pT9vuKlk failed, │ │ reason: connect ETIMEDOUT 185.146.173.20:443

Operating System

windows 11

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

3.46.5

Shell

No response

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

v16.20.1

What language and version are you using in your application?

Ruby version 3.2.2

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 27 (1 by maintainers)

Most upvoted comments

Hi everyone! I think I know what the issue is here, but took me some google translate to understand all the messages 🙏

The default authentication process doesn’t work if you are using a container or any other technology that prevents accessing localhost for a callback.

To fix this you need to use an alternative authentication method by setting this env variable: SHOPIFY_CLI_DEVICE_AUTH=1

Example for unix systems:

SHOPIFY_CLI_DEVICE_AUTH=1 shopify theme dev

For windows it depends on which shell you are using, but the solution is to set that environment variable.

Let me know if this helps

我今天用公司网络也没问题了。使用 Proxifer 是需要开VPN的,要将代理指向VPN。等Shopify解决是不知道要到什么时候的,要是实在没办法,可以用themekit的开发方式