i use mac,and in support country; but input "claude" reprot Unable to connect to Anthropic services;
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
I also see this error.
@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.
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
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…
MacOS user
I fixed it by deleting all those claude config files:
rm -rf ~/.claude*
and then reinstall claude, and it works.
I experienced the same issue on my Mac and finally found this solution worked for me:
- Open your
.claude.jsonin your home folder; - 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
}
- Restart claude and the issue is gone.
Hope this could help!
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
I experienced the same issue on my Mac and finally found this solution worked for me:
- Open your
.claude.jsonin your home folder;- Add the below line into the json and save;
"hasCompletedOnboarding": trueThe 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 }
- 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!
"hasCompletedOnboarding": true
This works. I was able to fix the error after adding this line.
我在我的 Mac 上遇到了同样的问题,最后发现这个解决方案对我有用:
- 在您的主文件夹中打开您的
.claude.json;- 将以下行添加到 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 }
- 重新启动 Claude,问题就消失了。
希望这能有所帮助!
Awesome, it can also be used on Windows
我在我的 Mac 上遇到了同样的问题,最后发现这个解决方案对我有用:
- 在您的主文件夹中打开您的
.claude.json;- 将以下行添加到 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 }
- 重新启动 Claude,问题就消失了。
希望这能有所帮助!
Awesome, it can also be used on Windows太棒了,它也可以在 Windows 系统上使用。
问题解决了,但是后续如何使用呢,无法登入Claude code
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.
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.
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.