How to fix npm ERR! cb() never called! npm ERR! This is an error with npm itself in npm

npmINTERMEDIATEMEDIUMUpdated Dec 6, 2025· 121 views

The "cb() never called" error is an internal npm failure, typically caused by cache corruption or network issues. Clear the npm cache and verify your network connection to resolve this.

Quick fix

Fixes npm ERR! cb() never called! npm ERR! This is an error with npm itself

# Verify cache integrity
npm cache verify

# If issues found, force clean
npm cache clean --force

# Retry installation
npm install
  1. Verify and clean npm cache
  2. Remove node_modules and lockfile
  3. Update npm to latest version
  4. Check network and proxy settings
npm — error
# Verify cache integrity
npm cache verify
# If issues found, force clean
npm cache clean --force
# Retry installation
npm install
npm ERR! cb() never called!
npm ERR! This is an error with npm itself

What this error means

The "cb() never called" error indicates npm's internal callback mechanism failed—the install process didn't complete properly. This is an npm-internal issue rather than a problem with your code or packages. The error message "This is an error with npm itself" is accurate. Common causes include corrupted npm cache, network interruptions during package downloads, proxy/firewall issues, or bugs in older npm versions.

Typical symptoms

  • npm install halts unexpectedly without clear error message
  • Installation hangs then times out with "cb() never called"
  • Error occurs intermittently (sometimes works, sometimes fails)
  • Works on retry without any code changes
  • Fails in CI/CD but works locally (or vice versa)
  • package-lock.json becomes corrupted after failure

Common causes

  1. Corrupted or overloaded npm cache
  2. Network interruptions during package downloads
  3. Proxy/firewall blocking npm registry access
  4. Outdated npm version with known bugs
  5. Custom registry configuration issues in .npmrc
  6. Insufficient disk space or memory
  7. SSL certificate validation failures

How to fix "npm ERR! cb() never called! npm ERR! This is an error with npm itself"

1Verify and clean npm cache

Start with cache verification, then clean if needed:

bash
# Verify cache integrity
npm cache verify

# If issues found, force clean
npm cache clean --force

# Retry installation
npm install
2Remove node_modules and lockfile

Reset the installation completely:

bash
# Remove cached files
rm -rf node_modules package-lock.json

# Clean npm cache
npm cache clean --force

# Reinstall
npm install
3Update npm to latest version

Older npm versions have known bugs:

bash
# Update npm globally
npm install -g npm@latest

# Verify version
npm -v

# Retry installation
npm install
4Check network and proxy settings

Verify connectivity to npm registry:

bash
# Test registry access
npm ping

# Check current configuration
npm config list

# If behind proxy, configure it
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
5Review .npmrc configuration

Check for problematic settings:

bash
# View .npmrc contents
cat ~/.npmrc

# Check for:
# - Malformed registry URLs
# - Expired authentication tokens
# - Invalid proxy settings

Remove or fix any problematic entries.

6Disable strict SSL if needed

For corporate networks with SSL inspection:

bash
# Disable strict SSL checking
npm config set strict-ssl false

# Retry installation
npm install

Note: Only use this behind trusted corporate proxies.

7Try without package-lock

As a diagnostic step:

bash
# Install without generating lockfile
npm install --no-package-lock

If this works, the issue is with lockfile generation.

Advanced notes

This error is most common in CI/CD environments and behind corporate proxies. For CI pipelines, use npm ci instead of npm install for more reliable installations.

If the error persists, try switching to Yarn temporarily—some users report Yarn handles flaky networks better than npm.

Cache location:
- Linux/macOS: ~/.npm
- Windows: %AppData%\npm-cache

Monitor disk space—npm cache can grow large and cause issues when disk is nearly full.

Frequently asked questions

What does "npm ERR! cb() never called! npm ERR! This is an error with npm itself" mean?
The "cb() never called" error indicates npm's internal callback mechanism failed—the install process didn't complete properly. This is an npm-internal issue rather than a problem with your code or packages. The error message "This is an error with npm itself" is accurate.
How do I fix "npm ERR! cb() never called! npm ERR! This is an error with npm itself"?
The "cb() never called" error is an internal npm failure, typically caused by cache corruption or network issues. Clear the npm cache and verify your network connection to resolve this.
What causes "npm ERR! cb() never called! npm ERR! This is an error with npm itself"?
Corrupted or overloaded npm cache Network interruptions during package downloads Proxy/firewall blocking npm registry access
Is the "npm ERR! cb() never called! npm ERR! This is an error with npm itself" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading