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.
Fixes npm ERR! code ENOENT npm ERR! syscall chmod npm ERR! path node_modules/.bin/command
# Remove node_modules and lock file
rm -rf node_modules package-lock.json
# Clear npm cache
npm cache clean --force
# Reinstall
npm install# Remove node_modules and lock filerm -rf node_modules package-lock.json# Clear npm cachenpm cache clean --force# Reinstallnpm installnpm ERR! code ENOENTnpm ERR! syscall chmodnpm ERR! path node_modules/.bin/command
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/).