How to fix npm ERR! code CERT_REVOKED npm ERR! errno CERT_REVOKED npm ERR! Certificate has been revoked in npm
The CERT_REVOKED error occurs when npm cannot verify the SSL/TLS certificate of the npm registry due to certificate revocation, outdated CA bundles, or network interference. This typically happens with older Node.js versions or corporate proxies.
Quick fix
Fixes npm ERR! code CERT_REVOKED npm ERR! errno CERT_REVOKED npm ERR! Certificate has been revoked
sudo timedatectl set-ntp true
sudo systemctl restart systemd-timesyncd- Check and fix system date and time
- Update Node.js and npm to the latest stable version
- Clear npm cache and retry
- Configure npm to use the correct CA certificates (for corporate networks)
sudo timedatectl set-ntp truesudo systemctl restart systemd-timesyncdnpm ERR! code CERT_REVOKEDnpm ERR! errno CERT_REVOKEDnpm ERR! Certificate has been revoked
What this error means
This error indicates that npm cannot establish a secure connection to the npm registry because the SSL/TLS certificate has been revoked or cannot be verified. The certificate revocation can occur for several reasons: the npm registry's certificate was actually revoked by its certificate authority, your system's certificate bundle is outdated and doesn't recognize the registry's CA chain, your system clock is out of sync causing certificate validation to fail, or a corporate proxy/firewall is intercepting the connection and presenting an untrusted certificate. When npm tries to download packages, it verifies the server's certificate against a chain of trusted Certificate Authorities (CAs). If any link in that chain is broken, revoked, or not in your system's trusted store, the connection fails with CERT_REVOKED or related errors.
Typical symptoms
- npm install, npm ci, or npm publish commands fail immediately with CERT_REVOKED
- Error message includes 'certificate revoked' or 'certificate has been revoked'
- Commands work fine in some environments but fail in others (especially corporate networks)
- Error persists even after clearing npm cache with npm cache clean --force
- Other Node.js or curl commands might work, but npm specifically fails
Common causes
- System date and time is incorrect, causing certificates to appear revoked or invalid
- Node.js and npm versions are outdated with expired built-in CA certificates
- Corporate proxy, firewall, or VPN is intercepting HTTPS traffic and presenting untrusted certificates
- Antivirus software (Kaspersky, Norton, etc.) is intercepting SSL connections
- System is missing updated root CA certificates or has an incomplete certificate chain
How to fix "npm ERR! code CERT_REVOKED npm ERR! errno CERT_REVOKED npm ERR! Certificate has been revoked"
An incorrect system clock is the most common cause. Ensure your system time is synchronized:
On Linux:
sudo timedatectl set-ntp true
sudo systemctl restart systemd-timesyncdOn macOS:
sudo systemsetup -setusingnetworktime onOn Windows:
- Go to Settings > Time & Language > Date & time
- Toggle 'Set time automatically' off and back on
Verify the current time is correct by visiting https://www.timeanddate.com/
Outdated versions of Node.js include old CA certificate bundles. Update to the latest stable release:
Using nvm (recommended):
nvm install node
nvm use node
npm install -g npm@latestOr download directly from https://nodejs.org/ and install the latest LTS version.
Verify the update:
node --version
npm --versionClear the npm cache to remove any corrupted certificate data:
npm cache clean --forceThen try your npm command again:
npm installIf you're behind a corporate proxy or firewall, you may need to specify additional CA certificates:
Option A - Set NODE_EXTRA_CA_CERTS environment variable:
export NODE_EXTRA_CA_CERTS=/path/to/company-ca.crt
npm installOption B - Configure npm to use a specific CA file:
npm config set cafile /path/to/company-ca.crtGet your company's root CA certificate from your IT department.
If all else fails, you can temporarily disable strict SSL checking. Use only for development on trusted networks:
npm config set strict-ssl falseTo verify the setting:
npm config get strict-sslRe-enable it when done:
npm config set strict-ssl trueWARNING: Disabling SSL verification exposes you to man-in-the-middle attacks. This should only be used temporarily in development environments.
Advanced notes
For corporate environments: If you're behind a proxy using tools like Zscaler, Kaspersky, or Palo Alto Networks, the issue is likely certificate interception. Contact your IT department for the root CA certificate and use the NODE_EXTRA_CA_CERTS environment variable rather than disabling SSL entirely. For antivirus issues: Some security software can interfere with SSL connections. Try temporarily disabling it to confirm, then whitelist Node.js/npm if the issue resolves. Check the npm status page at https://status.npmjs.org for any service disruptions.
Frequently asked questions
- What does "npm ERR! code CERT_REVOKED npm ERR! errno CERT_REVOKED npm ERR! Certif" mean?
- This error indicates that npm cannot establish a secure connection to the npm registry because the SSL/TLS certificate has been revoked or cannot be verified. The certificate revocation can occur for several reasons: the npm registry's certificate was actually revoked by its certificate authority, your system's certificate bundle is outdated and doesn't recognize the registry's CA chain, your system clock is out of sync causing certificate validation to fail, or a corporate proxy/firewall is intercepting the connection and presenting an untrusted certificate. When npm tries to download packages, it verifies the server's certificate against a chain of trusted Certificate Authorities (CAs).
- How do I fix "npm ERR! code CERT_REVOKED npm ERR! errno CERT_REVOKED npm ERR! Certif"?
- The CERT_REVOKED error occurs when npm cannot verify the SSL/TLS certificate of the npm registry due to certificate revocation, outdated CA bundles, or network interference. This typically happens with older Node.js versions or corporate proxies.
- What causes "npm ERR! code CERT_REVOKED npm ERR! errno CERT_REVOKED npm ERR! Certif"?
- System date and time is incorrect, causing certificates to appear revoked or invalid Node.js and npm versions are outdated with expired built-in CA certificates Corporate proxy, firewall, or VPN is intercepting HTTPS traffic and presenting untrusted certificates
- Is the "npm ERR! code CERT_REVOKED npm ERR! errno CERT_REVOKED npm ERR! Certif" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- ๐npm Official Documentation
- ๐ฌSO: SSL certificate error on Windows(Stack Overflow)
- ๐
- ๐ฌCommunity: SSL certificate validation error(Stack Overflow)