i use mac,and in support country; but input "claude" reprot Unable to connect to Anthropic services;

Status Closed — not planned
Maintainer reply None cached
Activity 14 comments · opened Jun 18, 2025 · closed Jan 11, 2026

Unable to connect to Anthropic services

Failed to connect to api.anthropic.com: ECONNREFUSED

Please check your internet connection and network settings.

Note: Claude Code might not be available in your country. Check supported
countries at https://anthropic.com/supported-countries

View original on GitHub ↗

14 Comments

mwarger · 1 year ago

I also see this error.

mwarger · 1 year ago

@xuhongxin I managed to figure out that when installing claude globally it was located in opt/homebrew since I had installed node with homebrew. I uninstalled node and also uninstalled node. I then used nvm to install node instead, and globally installed claude again with npm install -g @anthropic-ai/claude-code - at this point the installation was now in my nvm folder instead. I ran claude again and it worked.

xuhongxin · 1 year ago

thank you ,but my claude now is in the nvm path; the whole path is:

/Users/xuhongxin8477/.nvm/versions/node/v22.14.0/bin/claude;

and the error is still there

pandel · 1 year ago

I am also unable to start Claude code from the command line on my Mac:

➜ claude --verbose doctor

 Claude CLI Diagnostic
 Currently running: npm-local (1.0.58)
 Path: /usr/local/Cellar/node/24.4.1/bin/node
 Invoked: /Users/holger/.claude/local/node_modules/.bin/claude
 Config install method: local
 Auto-updates enabled: true
 Warning: Multiple installations found
 - npm-local at /Users/holger/.claude/local
 - npm-global at /usr/local/bin/claude
 Press Enter to continue…
NickJay159 · 1 year ago

MacOS user
I fixed it by deleting all those claude config files:

rm -rf ~/.claude*

and then reinstall claude, and it works.

dex1n · 1 year ago

I experienced the same issue on my Mac and finally found this solution worked for me:

  1. Open your .claude.json in your home folder;
  2. Add the below line into the json and save;
"hasCompletedOnboarding": true

The complete json after the modification would look like:

{
  "installMethod": "unknown",
  "autoUpdates": true,
  "userID": "[your_user_id]",
  "firstStartTime": "[time]",
  "projects": {
    "/Users/[your_home_folder]": {
      "allowedTools": [],
      "history": [],
      "mcpContextUris": [],
      "mcpServers": {},
      "enabledMcpjsonServers": [],
      "disabledMcpjsonServers": [],
      "hasTrustDialogAccepted": false,
      "projectOnboardingSeenCount": 0,
      "hasClaudeMdExternalIncludesApproved": false,
      "hasClaudeMdExternalIncludesWarningShown": false
    }
  },
  "hasCompletedOnboarding": true
}
  1. Restart claude and the issue is gone.

Hope this could help!

yu-liu24 · 1 year ago

i also see this error in linux server
thanks to @dex1n ! Following your nice suggestion, i add the below line into the .claude.json and it works!
"hasCompletedOnboarding": true

dx0611 · 1 year ago
I experienced the same issue on my Mac and finally found this solution worked for me: 1. Open your .claude.json in your home folder; 2. Add the below line into the json and save; `` "hasCompletedOnboarding": true ` The complete json after the modification would look like: ` { "installMethod": "unknown", "autoUpdates": true, "userID": "[your_user_id]", "firstStartTime": "[time]", "projects": { "/Users/[your_home_folder]": { "allowedTools": [], "history": [], "mcpContextUris": [], "mcpServers": {}, "enabledMcpjsonServers": [], "disabledMcpjsonServers": [], "hasTrustDialogAccepted": false, "projectOnboardingSeenCount": 0, "hasClaudeMdExternalIncludesApproved": false, "hasClaudeMdExternalIncludesWarningShown": false } }, "hasCompletedOnboarding": true } `` 3. Restart claude and the issue is gone. Hope this could help!

thx Following your nice suggestion, i add the below line into the .claude.json and it works!

KeanePutraSetiawan · 1 year ago
`` "hasCompletedOnboarding": true ``

This works. I was able to fix the error after adding this line.

Deep-Profile · 1 year ago
我在我的 Mac 上遇到了同样的问题,最后发现这个解决方案对我有用: 1. 在您的主文件夹中打开您的.claude.json; 2. 将以下行添加到 json 中并保存; `` "hasCompletedOnboarding": true ` 修改后的完整json如下: ` { "installMethod": "unknown", "autoUpdates": true, "userID": "[your_user_id]", "firstStartTime": "[time]", "projects": { "/Users/[your_home_folder]": { "allowedTools": [], "history": [], "mcpContextUris": [], "mcpServers": {}, "enabledMcpjsonServers": [], "disabledMcpjsonServers": [], "hasTrustDialogAccepted": false, "projectOnboardingSeenCount": 0, "hasClaudeMdExternalIncludesApproved": false, "hasClaudeMdExternalIncludesWarningShown": false } }, "hasCompletedOnboarding": true } `` 3. 重新启动 Claude,问题就消失了。 希望这能有所帮助!

Awesome, it can also be used on Windows

gitchar123 · 10 months ago
> 我在我的 Mac 上遇到了同样的问题,最后发现这个解决方案对我有用: > > 1. 在您的主文件夹中打开您的.claude.json; > 2. 将以下行添加到 json 中并保存; > > `` > "hasCompletedOnboarding": true > ` > > > > > > > > > > > > 修改后的完整json如下: > ` > { > "installMethod": "unknown", > "autoUpdates": true, > "userID": "[your_user_id]", > "firstStartTime": "[time]", > "projects": { > "/Users/[your_home_folder]": { > "allowedTools": [], > "history": [], > "mcpContextUris": [], > "mcpServers": {}, > "enabledMcpjsonServers": [], > "disabledMcpjsonServers": [], > "hasTrustDialogAccepted": false, > "projectOnboardingSeenCount": 0, > "hasClaudeMdExternalIncludesApproved": false, > "hasClaudeMdExternalIncludesWarningShown": false > } > }, > "hasCompletedOnboarding": true > } > `` > > > > > > > > > > > > > 3. 重新启动 Claude,问题就消失了。 > > 希望这能有所帮助! Awesome, it can also be used on Windows太棒了,它也可以在 Windows 系统上使用。

问题解决了,但是后续如何使用呢,无法登入Claude code

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.