How to fix npm ERR! code CERT_REVOKED npm ERR! errno CERT_REVOKED npm ERR! Certificate has been revoked in npm

npmINTERMEDIATEHIGHUpdated Dec 5, 2025ยท 119 views

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
  1. Check and fix system date and time
  2. Update Node.js and npm to the latest stable version
  3. Clear npm cache and retry
  4. Configure npm to use the correct CA certificates (for corporate networks)
npm โ€” error
sudo timedatectl set-ntp true
sudo systemctl restart systemd-timesyncd
npm ERR! code CERT_REVOKED
npm ERR! errno CERT_REVOKED
npm 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

  1. System date and time is incorrect, causing certificates to appear revoked or invalid
  2. Node.js and npm versions are outdated with expired built-in CA certificates
  3. Corporate proxy, firewall, or VPN is intercepting HTTPS traffic and presenting untrusted certificates
  4. Antivirus software (Kaspersky, Norton, etc.) is intercepting SSL connections
  5. 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"

1Check and fix system date and time

An incorrect system clock is the most common cause. Ensure your system time is synchronized:

On Linux:

bash
sudo timedatectl set-ntp true
sudo systemctl restart systemd-timesyncd

On macOS:

bash
sudo systemsetup -setusingnetworktime on

On 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/

2Update Node.js and npm to the latest stable version

Outdated versions of Node.js include old CA certificate bundles. Update to the latest stable release:

Using nvm (recommended):

bash
nvm install node
nvm use node
npm install -g npm@latest

Or download directly from https://nodejs.org/ and install the latest LTS version.

Verify the update:

bash
node --version
npm --version
3Clear npm cache and retry

Clear the npm cache to remove any corrupted certificate data:

bash
npm cache clean --force

Then try your npm command again:

bash
npm install
4Configure npm to use the correct CA certificates (for corporate networks)

If 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:

bash
export NODE_EXTRA_CA_CERTS=/path/to/company-ca.crt
npm install

Option B - Configure npm to use a specific CA file:

bash
npm config set cafile /path/to/company-ca.crt

Get your company's root CA certificate from your IT department.

5Disable strict SSL verification (temporary workaround only)

If all else fails, you can temporarily disable strict SSL checking. Use only for development on trusted networks:

bash
npm config set strict-ssl false

To verify the setting:

bash
npm config get strict-ssl

Re-enable it when done:

bash
npm config set strict-ssl true

WARNING: 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