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.
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.
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.
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.
npm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name: tag names cannot contain spaces
How to fix "npm ERR! code EINVALIDTAGNAME - tag names cannot contain spaces"
npm ERR! code E400 npm ERR! 400 Bad Request
How to fix "npm ERR! code E400 - 400 Bad Request" error