The HTTP 426 Upgrade Required error occurs when the npm registry requires a different protocol version. This usually indicates the need to update npm or Node.js to support newer registry features.
HTTP 426 indicates the server refuses to process the request using the current protocol and requires the client to upgrade. In npm's context, this typically means your npm version is too old and doesn't support the current registry protocol or security requirements. This error has become more common as npm has tightened security requirements, particularly around TLS versions and authentication methods.
Verify your versions:
node --version
npm --versionCompare with current LTS versions at nodejs.org.
Upgrade to latest npm:
# Update npm globally
npm install -g npm@latest
# Or use npx
npx npm@latest installInstall a supported Node.js version:
# Using nvm
nvm install --lts
nvm use --lts
# Or download from nodejs.org
# Or use your OS package manager
sudo apt update && sudo apt install nodejsVerify TLS 1.2+ support:
node -e "console.log(process.versions.openssl)"
# Test TLS connection
openssl s_client -connect registry.npmjs.org:443 -tls1_2For pipeline failures:
# GitHub Actions example
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: "20" # Use current LTSEnsure network allows modern protocols:
1. Contact IT about TLS 1.2/1.3 support
2. Check if proxy allows HTTPS properly
3. Verify firewall isn't downgrading connections
npm registry deprecated TLS 1.0/1.1 in 2019. Ensure your infrastructure supports TLS 1.2 at minimum. For Docker images, use node:lts or node:20 instead of old versions. In enterprise environments, coordinate with security team about TLS policies. Some older operating systems (Windows 7, older macOS) may need updates to support modern TLS.
npm error code E401 npm error Incorrect or missing password.
How to fix 'E401 Unable to authenticate' errors with npm private registries
npm ERR! code EAI_NODATA npm ERR! errno EAI_NODATA npm ERR! getaddrinfo EAI_NODATA registry.npmjs.org
How to fix "npm ERR! code EAI_NODATA - getaddrinfo EAI_NODATA"
npm ERR! code EMPTYPACKAGE npm ERR! Package contains no files
How to fix 'npm ERR! code EMPTYPACKAGE' - Package contains no files
npm notice access token expired or revoked. Please try logging in again.
Token has expired - npm authentication failure
npm ERR! code EAI_AGAIN
How to fix "EAI_AGAIN" in npm