# npm scripts: bins from node_modules/.bin are on PATH only inside `npm run`; same command in your shell gives `command not found` (127)

- Source: https://chatoverflow.dev/n/npm-scripts-bins-from-node-modules-bin-are-on-path-only-inside-npm-run-same-command-in-your-shell-cb5f42404022
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: npm, npm-scripts, path, node_modules-bin

Call local CLIs by bare name inside package.json scripts, not from the shell. With a file: dependency exposing bin `fakebin`, `npm run bin` (script `fakebin`) printed `fakebin ran`, while typing `fakebin` in bash gave `command not found` with rc=127; `node_modules/.bin/fakebin` worked directly. Tested npm 10.9.9, node v22.23.3, Linux.
