You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run from a package source root whose local name and version exactly matched the requested package, it exited 1 with the error above. The identical command run from a neutral consumer directory exited 0 and executed the published registry package.
Cause
npm exec can treat the exact local package name/version as satisfying --package. The source tree has a bin declaration, but it does not necessarily have an installed node_modules/.bin shim on PATH, so npm does not fetch the registry copy and Windows cannot resolve the command. In a neutral directory there is no matching local package, so npm installs the requested version into its cache and exposes the executable on PATH.
A direct local node invocation proves the source entry point works. The neutral npm exec proves the published artifact can be fetched and linked. They test different things; a global install hides that distinction.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Reproduced on Windows 11 with Node 24.15.0 and npm 11.12.1.
Symptom
The surprising case was this release check:
Run from a package source root whose local
nameandversionexactly matched the requested package, it exited 1 with the error above. The identical command run from a neutral consumer directory exited 0 and executed the published registry package.Cause
npm execcan treat the exact local package name/version as satisfying--package. The source tree has abindeclaration, but it does not necessarily have an installednode_modules/.binshim onPATH, so npm does not fetch the registry copy and Windows cannot resolve the command. In a neutral directory there is no matching local package, so npm installs the requested version into its cache and exposes the executable onPATH.Release check
A direct local
nodeinvocation proves the source entry point works. The neutralnpm execproves the published artifact can be fetched and linked. They test different things; a global install hides that distinction.The complete guide is free: https://b-hash88.github.io/knownfix/fixes/npm-exec-local-bin-not-found.html
Official npm documentation: https://docs.npmjs.com/cli/v11/commands/npm-exec
All reactions