Update Fails Behind Corporate Proxy (2026)
The Error
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/@anthropic-ai/claude-code failed
npm ERR! network This is a problem related to network connectivity.
This error occurs when npm update -g @anthropic-ai/claude-code fails because the corporate proxy blocks or times out connections to the npm registry.
The Fix
- Configure npm to use your corporate proxy:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
- If the proxy requires authentication:
npm config set proxy http://username:password@proxy.company.com:8080
npm config set https-proxy http://username:password@proxy.company.com:8080
- Retry the update:
npm update -g @anthropic-ai/claude-code
- If the proxy uses a custom CA certificate:
npm config set cafile /path/to/corporate-ca.crt
Why This Happens
Corporate networks route outbound HTTPS traffic through a proxy server for security monitoring. npm does not automatically detect proxy settings from system environment variables on all platforms. Without explicit proxy configuration, npm’s requests to registry.npmjs.org time out because they cannot reach the internet directly.
If That Doesn’t Work
- Use environment variables instead of npm config:
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080
npm update -g @anthropic-ai/claude-code
- Use a private npm registry mirror if your company has one:
npm config set registry https://npm.company.com/
- Download the package manually and install from tarball:
# On a machine with internet access:
npm pack @anthropic-ai/claude-code
# Transfer the .tgz file, then:
npm install -g anthropic-ai-claude-code-*.tgz
Prevention
Add this to your CLAUDE.md:
# Corporate Proxy
- Set npm proxy config: npm config set https-proxy http://proxy:8080
- Add corporate CA cert: npm config set cafile /path/to/ca.crt
- Document proxy URL in project README for new team members.
See Also
- MITM Proxy Detection Error — Fix (2026)
- Self-Signed Cert in Corporate Proxy — Fix (2026)
- SOCKS Proxy Not Supported Error — Fix (2026)
Related Error Messages
This fix also applies if you see variations of this error:
- Connection or process errors with similar root causes in the same subsystem
- Timeout variants where the operation starts but does not complete
- Permission variants where access is denied to the same resource
- Configuration variants where the same setting is missing or malformed
If your specific error message differs slightly from the one shown above, the fix is likely the same. The key indicator is the operation that failed (shown in the stack trace) rather than the exact wording of the message.
Frequently Asked Questions
Does this error affect all operating systems?
This error can occur on macOS, Linux, and Windows (WSL). The exact error message may differ slightly between platforms, but the root cause and fix are the same. macOS users may see additional Gatekeeper or notarization prompts. Linux users should check that the relevant system packages are installed. Windows users should ensure they are running inside WSL2, not native Windows.
Will this error come back after updating Claude Code?
Updates can occasionally reintroduce this error if the update changes default configurations or dependency requirements. After updating Claude Code, verify your project still builds and runs correctly. If the error returns, reapply the fix and check the changelog for breaking changes.
Can this error cause data loss?
No, this error occurs before or during an operation and does not corrupt existing files. Claude Code’s edit operations are atomic — they either complete fully or not at all. However, if the error occurs during a multi-step operation, you may have partial changes that need to be reviewed with git diff before continuing.
How do I report this error to Anthropic if the fix does not work?
Open an issue at github.com/anthropics/claude-code with: (1) the full error message including stack trace, (2) your Node.js version (node --version), (3) your Claude Code version (claude --version), (4) your operating system and version, and (5) the command or operation that triggered the error.
Related Guides
Try it: Paste your error into our Error Diagnostic for an instant fix.