This warning appears when two packages try to install executables with the same name in node_modules/.bin. The last installed package wins, potentially causing unexpected behavior.
When npm installs packages, it creates executable symlinks in node_modules/.bin/. If two packages declare the same binary name in their package.json "bin" field, they conflict. npm installs both but only one symlink can exist—the last installed package overwrites the first. This is a design limitation in npm. The warning alerts you that running the binary might execute a different package than expected. Common with packages like TypeScript (@tsd/typescript vs typescript both providing "tsc"). Install order determines which binary "wins," making builds potentially non-deterministic.
Check which packages are conflicting:
# List .bin contents
ls -la node_modules/.bin/
# See which package a binary points to
cat node_modules/.bin/tsc
# Look for the path in the scriptReference the exact package you want:
{
"scripts": {
"compile": "node ./node_modules/typescript/bin/tsc",
"check": "node ./node_modules/@tsd/typescript/bin/tsc"
}
}npx can target specific packages:
# Run typescript's tsc
npx -p typescript tsc --version
# Run @tsd/typescript's tsc
npx -p @tsd/typescript tsc --versionIn package.json:
{
"scripts": {
"build": "npx -p typescript tsc"
}
}If one package is unnecessary, remove it:
# Check why package is installed
npm ls @tsd/typescript
# If direct dependency, uninstall
npm uninstall @tsd/typescriptIf it's a transitive dependency, check if the parent package can be updated.
Ensure consistent install order:
# In CI/CD, use npm ci
npm ciVerify which binary won:
cat node_modules/.bin/[binary-name]For package maintainers, avoid generic binary names:
Bad:
{ "bin": { "cli": "./bin/cli.js" } }Good:
{ "bin": { "mypackage-cli": "./bin/cli.js" } }npm doesn't provide built-in resolution—the last installed package wins. This is a known limitation dating back to npm v3. Using direct paths or npx with package specifiers is the most reliable workaround.
npm ERR! code E401 npm ERR! 401 Unauthorized - Token has expired
Token has expired - npm authentication failure
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 EAI_NODATA npm ERR! errno EAI_NODATA npm ERR! getaddrinfo EAI_NODATA registry.npmjs.org
How to fix "npm ERR! code EAI_NODATA - getaddrinfo EAI_NODATA"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"