This error occurs when npm cannot find or access an executable binary in node_modules/.bin during installation. It's typically caused by corrupted node_modules, broken symlinks, or filesystem issues.
The ENOENT (Error NO ENTry) error with syscall chmod indicates npm tried to set executable permissions on a binary file that doesn't exist or is inaccessible. When npm installs packages with CLI tools (like webpack, eslint, prettier), it creates symlinks in node_modules/.bin/ pointing to the actual executables. The chmod operation sets these as executable. This error occurs when the symlink target is missing or the filesystem doesn't support the operation. Common in scenarios involving interrupted installations, shared folders (Vagrant/Docker), or filesystem limitations (FAT32, some NTFS mounts).
Remove everything and reinstall:
# Remove node_modules and lock file
rm -rf node_modules package-lock.json
# Clear npm cache
npm cache clean --force
# Reinstall
npm installWindows:
Remove-Item -Recurse -Force node_modules
Remove-Item package-lock.json
npm cache clean --force
npm installIf you want to preserve node_modules, try rebuilding:
npm rebuildThis regenerates .bin symlinks without re-downloading packages.
If using Vagrant, Docker volumes, or similar:
npm install --no-bin-linksThen use npx or direct paths to run binaries:
# Instead of: webpack
npx webpack
# Or: node ./node_modules/webpack/bin/webpack.jsKill any active Node processes that might lock files:
# Linux/macOS
pkill -f node
# Windows
taskkill /IM node.exe /FThen retry npm install.
Ensure you own the npm directories:
# Linux/macOS
sudo chown -R $(whoami) node_modules
sudo chown -R $(whoami) ~/.npm
# Verify permissions
ls -la node_modules/.bin/Platform-specific solutions:
Vagrant: Enable symlinks in Vagrantfile:
vb.customize ["setextradata", :id,
"VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]Docker: Use named volumes instead of bind mounts for node_modules:
volumes:
- .:/app
- /app/node_modules # Anonymous volume prevents host mountWSL: Ensure project is in Linux filesystem (~/project) not Windows mount (/mnt/c/).
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