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_modules folder, 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 prefix
  • npm help folders
  • npm help config
  • npm 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