xref: /third_party/node/deps/npm/man/man1/npm-prefix.1 (revision 1cb0ef41)
"NPM-PREFIX" "1" "February 2024" "" ""
"NAME"
npm-prefix - Display prefix
"Synopsis"

npm prefix \[lB]-g\[rB]

Note: This command is unaware of workspaces.

"Description"

Print the local prefix to standard output. This is the closest parent directory to contain a package.json file or node_modules directory, unless -g is also specified.

If -g is specified, this will be the value of the global prefix. See npm help config for more detail.

"Example"

npm prefix
/usr/local/projects/foo

npm prefix -g
/usr/local
"Configuration"
"global"

\(bu 4
Default: false
\(bu 4
Type: Boolean

Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See npm help folders for more on the differences in behavior.

\(bu 4
packages are installed into the {prefix}/lib/node_modules folder, instead of the current working directory.
\(bu 4
bin files are linked to {prefix}/bin
\(bu 4
man pages are linked to {prefix}/share/man
"See Also"

\(bu 4
npm help root
\(bu 4
npm help folders
\(bu 4
npm help config
\(bu 4
npm help npmrc