How to fix npm ERR! code ENOBIN npm ERR! No binary found for package in npm
Binary-related npm errors occur when package executables aren't properly installed or linked. Clear node_modules, reinstall dependencies, and ensure your npm version is compatible with your lockfile.
Quick fix
Fixes ENOBIN
rm -rf node_modules package-lock.json
npm install- Delete node_modules and reinstall
- Clear npm cache
- Check .bin directory contents
- Use npm ci instead of npm install
rm -rf node_modules package-lock.jsonnpm installnpm ERR! code ENOBINnpm ERR! No binary found for package
What this error means
This error indicates that npm couldn't find or create the executable binary for a package. When you install packages with CLI tools (like typescript, eslint, or vite), npm creates symlinks in node_modules/.bin that point to the package's executable files. If this process fails, the binaries won't be available. The issue typically manifests when trying to run a tool that should have been installed—for example, running `npx tsc` after installing TypeScript but getting a "not found" error. The package exists in node_modules, but the executable link is missing. This can happen due to npm version incompatibilities, corrupted installations, filesystem issues (especially on Windows or in Docker), or race conditions during parallel installations.
Typical symptoms
- node_modules/.bin directory is empty or missing expected executables
- "command not found" when running installed CLI tools
- Package appears in node_modules but isn't executable
- npm install completes but binaries aren't available
- npx commands fail to find locally installed packages
- Scripts in package.json can't find tools they depend on
- Works on one machine but fails on another
Common causes
- Corrupted node_modules directory
- npm version mismatch between lockfile creation and current install
- Race condition during parallel package installation
- Filesystem doesn't support symlinks (some Windows configurations)
- Active processes locking files during installation
- Vagrant or VM shared folders preventing symlink creation
- Incomplete or interrupted npm install
How to fix "npm ERR! code ENOBIN npm ERR! No binary found for package"
The most reliable fix is a clean reinstall:
rm -rf node_modules package-lock.json
npm installThis removes any corrupted state and regenerates the lockfile with proper binary links.
Cached packages might be corrupted:
npm cache clean --force
npm cache verify
npm installThe verify command checks cache integrity and removes corrupted entries.
Verify what binaries exist:
ls -la node_modules/.bin/If it's empty or missing expected tools, the installation didn't complete properly. If the directory doesn't exist at all, npm failed to create it.
For CI environments and reproducible builds:
npm ciThis command removes node_modules, installs exactly what's in package-lock.json, and is more reliable for creating binary links.
On Windows, Vagrant, or shared folders where symlinks fail:
npm install --no-bin-linksThis creates copies instead of symlinks. Note that some tools may not work correctly without proper symlinks.
Older versions have known binary installation bugs:
# Check versions
node --version
npm --version
# Update npm
npm install -g npm@latestUse nvm to manage Node.js versions and ensure consistency across environments.
Advanced notes
On Windows, npm historically had issues with symlinks due to permission requirements. Windows 10+ supports symlinks better, but you may need to enable Developer Mode or run your terminal as Administrator.
In Docker, if you mount node_modules as a volume, the .bin directory from your host might not be compatible with the container's architecture. Use named volumes or rebuild node_modules inside the container:
COPY package*.json ./
RUN npm ci
COPY . .For Vagrant users, the --no-bin-links flag is often necessary when the node_modules directory is on a shared folder. Alternatively, place node_modules outside the shared folder using npm's prefix configuration.
Frequently asked questions
- What does "ENOBIN" mean?
- This error indicates that npm couldn't find or create the executable binary for a package. bin that point to the package's executable files. If this process fails, the binaries won't be available.
- How do I fix "ENOBIN"?
- Binary-related npm errors occur when package executables aren't properly installed or linked. Clear node_modules, reinstall dependencies, and ensure your npm version is compatible with your lockfile.
- What causes "ENOBIN"?
- Corrupted node_modules directory npm version mismatch between lockfile creation and current install Race condition during parallel package installation
- Is the "ENOBIN" 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
- 🔗
- 🐙GitHub #4308: npm/cli(GitHub)
- 💬Stack Overflow: npm not creating bin directory(Stack Overflow)