npm root -g

Category: Node.js & npm/yarn

npm root -g

Print the global node_modules directory

Shows the folder that holds globally installed packages, normally a sibling of the npm binary itself. Binaries from those packages are linked into the global bin directory. Useful when debugging why a global tool cannot be found.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.