npm-prefix

prints the local or global prefix path

TLDR

Show local prefix
$ npm prefix
Show global prefix
$ npm prefix -g

SYNOPSIS

npm prefix [options]

DESCRIPTION

npm prefix prints the local or global prefix path. Shows where packages are installed.The command displays installation directory. Useful for scripting.

PARAMETERS

-g

Global prefix.
--help
Display help information.

INSTALL

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

CAVEATS

Local shows closest package.json dir. Global shows npm global path.

HISTORY

npm prefix helps locate package installation directories for scripts and debugging.

SEE ALSO

npm(1), npm-root(1), npm-bin(1)