How to fix npm ERR! code ENOBIN npm ERR! No binary found for package in npm

npmINTERMEDIATEMEDIUMUpdated Dec 6, 2025· 128 views

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
  1. Delete node_modules and reinstall
  2. Clear npm cache
  3. Check .bin directory contents
  4. Use npm ci instead of npm install
npm — error
rm -rf node_modules package-lock.json
npm install
npm ERR! code ENOBIN
npm 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

  1. Corrupted node_modules directory
  2. npm version mismatch between lockfile creation and current install
  3. Race condition during parallel package installation
  4. Filesystem doesn't support symlinks (some Windows configurations)
  5. Active processes locking files during installation
  6. Vagrant or VM shared folders preventing symlink creation
  7. Incomplete or interrupted npm install

How to fix "npm ERR! code ENOBIN npm ERR! No binary found for package"

1Delete node_modules and reinstall

The most reliable fix is a clean reinstall:

bash
rm -rf node_modules package-lock.json
npm install

This removes any corrupted state and regenerates the lockfile with proper binary links.

2Clear npm cache

Cached packages might be corrupted:

bash
npm cache clean --force
npm cache verify
npm install

The verify command checks cache integrity and removes corrupted entries.

3Check .bin directory contents

Verify what binaries exist:

bash
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.

4Use npm ci instead of npm install

For CI environments and reproducible builds:

bash
npm ci

This command removes node_modules, installs exactly what's in package-lock.json, and is more reliable for creating binary links.

5Disable symlinks for problematic environments

On Windows, Vagrant, or shared folders where symlinks fail:

bash
npm install --no-bin-links

This creates copies instead of symlinks. Note that some tools may not work correctly without proper symlinks.

6Update Node.js and npm

Older versions have known binary installation bugs:

bash
# Check versions
node --version
npm --version

# Update npm
npm install -g npm@latest

Use 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:

dockerfile
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