LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

npm-bin

prints the folder where npm will install executables

TLDR

Show local bin directory
$ npm bin
copy
Show global bin directory
$ npm bin -g
copy
Add local bin to PATH
$ export PATH="$(npm bin):$PATH"
copy

SYNOPSIS

npm bin [options]

DESCRIPTION

npm bin prints the folder where npm will install executables. For local installations, this is typically ./node_modules/.bin; for global, it depends on npm prefix.Adding the local bin to PATH allows running locally installed tools.

PARAMETERS

-g, --global

Show global bin directory.

EXAMPLE USAGE

$ # Show local bin
npm bin
# Output: /project/node_modules/.bin

# Show global bin
npm bin -g
# Output: /usr/local/bin

# Run local binary
$(npm bin)/eslint .

# Or add to PATH
export PATH="$(npm bin):$PATH"
eslint .
copy

ALTERNATIVES

$ # Use npx instead
npx eslint .

# Or npm exec
npm exec eslint .
copy

INSTALL

sudo pacman -S npm
copy
sudo apk add npm
copy
brew install npm
copy

CAVEATS

Local bin changes per project. Global path varies by installation method. npx is often simpler for running binaries.

HISTORY

npm bin has been part of npm since early versions, helping developers locate and use locally installed executables.

SEE ALSO

npm(1), npx(1), npm-exec(1), npm-prefix(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid