Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npm-explain.1119 linesDownload Raw Back to man1
1.TH "NPM-EXPLAIN" "1" "April 2026" "NPM@11.13.0" ""
2.SH "NAME"
3\fBnpm-explain\fR - Explain installed packages
4.SS "Synopsis"
5.P
6.RS 2
7.nf
8npm explain <package-spec>
9
10alias: why
11.fi
12.RE
13.SS "Description"
14.P
15This command will print the chain of dependencies causing a given package to be installed in the current project.
16.P
17If one or more package specs are provided, then only packages matching one of the specifiers will have their relationships explained.
18.P
19The package spec can also refer to a folder within \fB./node_modules\fR
20.P
21For example, running \fBnpm explain glob\fR within npm's source tree will show:
22.P
23.RS 2
24.nf
25glob@7.1.6
26node_modules/glob
27  glob@"^7.1.4" from the root project
28
29glob@7.1.1 dev
30node_modules/tacks/node_modules/glob
31  glob@"^7.0.5" from rimraf@2.6.2
32  node_modules/tacks/node_modules/rimraf
33    rimraf@"^2.6.2" from tacks@1.3.0
34    node_modules/tacks
35      dev tacks@"^1.3.0" from the root project
36.fi
37.RE
38.P
39To explain just the package residing at a specific folder, pass that as the argument to the command. This can be useful when trying to figure out exactly why a given dependency is being duplicated to satisfy conflicting version requirements within the project.
40.P
41.RS 2
42.nf
43$ npm explain node_modules/nyc/node_modules/find-up
44find-up@3.0.0 dev
45node_modules/nyc/node_modules/find-up
46  find-up@"^3.0.0" from nyc@14.1.1
47  node_modules/nyc
48    nyc@"^14.1.1" from tap@14.10.8
49    node_modules/tap
50      dev tap@"^14.10.8" from the root project
51.fi
52.RE
53.SS "Configuration"
54.SS "\fBjson\fR"
55.RS 0
56.IP \(bu 4
57Default: false
58.IP \(bu 4
59Type: Boolean
60.RE 0
61
62.P
63Whether or not to output JSON data, rather than the normal output.
64.RS 0
65.IP \(bu 4
66In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR.
67.RE 0
68
69.P
70Not supported by all npm commands.
71.SS "\fBworkspace\fR"
72.RS 0
73.IP \(bu 4
74Default:
75.IP \(bu 4
76Type: String (can be set multiple times)
77.RE 0
78
79.P
80Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.
81.P
82Valid values for the \fBworkspace\fR config are either:
83.RS 0
84.IP \(bu 4
85Workspace names
86.IP \(bu 4
87Path to a workspace directory
88.IP \(bu 4
89Path to a parent workspace directory (will result in selecting all workspaces within that folder)
90.RE 0
91
92.P
93When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project.
94.P
95This value is not exported to the environment for child processes.
96.SS "See Also"
97.RS 0
98.IP \(bu 4
99npm help "package spec"
100.IP \(bu 4
101npm help config
102.IP \(bu 4
103npm help npmrc
104.IP \(bu 4
105npm help folders
106.IP \(bu 4
107npm help ls
108.IP \(bu 4
109npm help install
110.IP \(bu 4
111npm help link
112.IP \(bu 4
113npm help prune
114.IP \(bu 4
115npm help outdated
116.IP \(bu 4
117npm help update
118.RE 0
119 
codekingpro/portable-devtools · Team Ai