NPM-ROOT(1)
π NAME π
ok so this is npm-root β the man page for npm root, aka the npm command that literally just tells you where your stuff lives. Like the manual page name is NPM-ROOT(1) bestie, and it's here to spill the location of your node_modules. π
β¨ Synopsis β¨
npm root
heads up bestie: this command is unaware of workspaces. no cap. it does not know they exist. π
π¦ Description π¦
It prints the effective node_modules folder to standard out. that's it. that's the whole vibe. π
it's highkey useful when you're using npm inside shell scripts that do stuff with the node_modules folder β iykyk. for example:
#!/bin/bash
global_node_modules="$(npm root --global)"
echo "Global packages installed in: ${global_node_modules}"
see? iconic. it just tells you where the global packages went. π«Ά
π Configuration π
β global β
- Default:
false - Type:
Boolean
this makes npm operate in "global" mode, so packages get installed into the prefix folder instead of the current working directory. want the full tea on how the behavior differs? run npm help folders fr fr.
- π¦ packages are installed into the
{prefix}/lib/node_modulesfolder, instead of the current working directory. - π bin files are linked to
{prefix}/bin - π man pages are linked to
{prefix}/share/man
π See Also π
npm help prefixnpm help foldersnpm help confignpm help npmrc
that's a wrap bestie π§β¨ this masterpiece is from NPM@12.2.1, dated October 2026 β go forth and find your node_modules, you absolute main character. ππΈ
π¦ where this page comes from
- arch rolling: npm 12.2.1-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms