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 notice access token expired or revoked. Please try logging in again.
Token has expired - npm authentication failure
npm ERR! code EAI_AGAIN
How to fix "EAI_AGAIN" in npm
npm error code E403 npm error 403 Forbidden - PUT https://registry.npmjs.org/<package>
How to fix 'E403 Forbidden' error in npm
npm ERR! code EUSAGE npm ERR! Usage error
How to fix "npm ERR! code EUSAGE" in Node.js projects
npm ERR! code E401 npm ERR! 401 Unauthorized
How to fix "E401 Unauthorized" in npm