How to fix npm ERR! cb() never called! npm ERR! This is an error with npm itself in npm
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- Verify and clean npm cache
- Remove node_modules and lockfile
- Update npm to latest version
- Check network and proxy settings
# Verify cache integritynpm cache verify# If issues found, force cleannpm cache clean --force# Retry installationnpm installnpm 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
- Corrupted or overloaded npm cache
- Network interruptions during package downloads
- Proxy/firewall blocking npm registry access
- Outdated npm version with known bugs
- Custom registry configuration issues in .npmrc
- Insufficient disk space or memory
- SSL certificate validation failures
How to fix "npm ERR! cb() never called! npm ERR! This is an error with npm itself"
Start with cache verification, then clean if needed:
# Verify cache integrity
npm cache verify
# If issues found, force clean
npm cache clean --force
# Retry installation
npm installReset the installation completely:
# Remove cached files
rm -rf node_modules package-lock.json
# Clean npm cache
npm cache clean --force
# Reinstall
npm installOlder npm versions have known bugs:
# Update npm globally
npm install -g npm@latest
# Verify version
npm -v
# Retry installation
npm installVerify connectivity to npm registry:
# 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:8080Check for problematic settings:
# View .npmrc contents
cat ~/.npmrc
# Check for:
# - Malformed registry URLs
# - Expired authentication tokens
# - Invalid proxy settingsRemove or fix any problematic entries.
For corporate networks with SSL inspection:
# Disable strict SSL checking
npm config set strict-ssl false
# Retry installation
npm installNote: Only use this behind trusted corporate proxies.
As a diagnostic step:
# Install without generating lockfile
npm install --no-package-lockIf 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
- 📚npm Official Documentation
- 💬Stack Overflow: npm err cb never called(Stack Overflow)
- 🐙GitHub #1916: npm/cli(GitHub)
- 🐙GitHub #17839: npm/npm(GitHub)