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.
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.
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.
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.
npm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name: tag names cannot contain spaces
How to fix "npm ERR! code EINVALIDTAGNAME - tag names cannot contain spaces"
npm ERR! code E400 npm ERR! 400 Bad Request
How to fix "npm ERR! code E400 - 400 Bad Request" error