1NPM-ROOT(1)                                                        NPM-ROOT(1)
2
3
4

NAME

6       npm-root - Display npm root
7
8   Synopsis
9         npm root
10
11   Description
12       Print the effective node_modules folder to standard out.
13
14       Useful for using npm in shell scripts that do things with the node_mod‐
15       ules folder.  For example:
16
17         #!/bin/bash
18         global_node_modules="$(npm root --global)"
19         echo "Global packages installed in: ${global_node_modules}"
20
21   Configuration
22   global
23       • Default: false
24
25       • Type: Boolean
26
27
28       Operates in "global" mode, so that packages are installed into the pre‐
29       fix folder instead of the current working directory. See npm help fold‐
30       ers for more on the differences in behavior.
31
32       • packages are installed into the {prefix}/lib/node_modules folder, in‐
33         stead of the current working directory.
34
35       • bin files are linked to {prefix}/bin
36
37       • man pages are linked to {prefix}/share/man
38
39
40   See Also
41       • npm help prefix
42
43       • npm help bin
44
45       • npm help folders
46
47       • npm help config
48
49       • npm help npmrc
50
51
52
53
54                                September 2022                     NPM-ROOT(1)
Impressum