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

NAME

6       npm-config - Manage the npm configuration files
7
8   Synopsis
9         npm config set <key>=<value> [<key>=<value> ...]
10         npm config get [<key> [<key> ...]]
11         npm config delete <key> [<key> ...]
12         npm config list [--json]
13         npm config edit
14
15         alias: c
16
17       Note: This command is unaware of workspaces.
18
19   Description
20       npm  gets  its config settings from the command line, environment vari‐
21       ables, npmrc files, and in some cases, the package.json file.
22
23       See npm help npmrc for more information about the npmrc files.
24
25       See npm help config(7) for a more thorough explanation  of  the  mecha‐
26       nisms involved, and a full list of config options available.
27
28       The  npm  config command can be used to update and edit the contents of
29       the user and global npmrc files.
30
31   Sub-commands
32       Config supports the following sub-commands:
33
34   set
35         npm config set key=value [key=value...]
36         npm set key=value [key=value...]
37
38       Sets each of the config keys to the value provided.
39
40       If value is omitted, then it sets it to an empty string.
41
42       Note: for backwards compatibility, npm config set  key  value  is  sup‐
43       ported as an alias for npm config set key=value.
44
45   get
46         npm config get [key ...]
47         npm get [key ...]
48
49       Echo the config value(s) to stdout.
50
51       If  multiple  keys  are provided, then the values will be prefixed with
52       the key names.
53
54       If no keys are provided, then this command behaves the same as npm con‐
55       fig list.
56
57   list
58         npm config list
59
60       Show  all the config settings. Use -l to also show defaults. Use --json
61       to show the settings in json format.
62
63   delete
64         npm config delete key [key ...]
65
66       Deletes the specified keys from all configuration files.
67
68   edit
69         npm config edit
70
71       Opens the config file in an editor.  Use the --global flag to edit  the
72       global config.
73
74   Configuration
75   json
76       • Default: false
77
78       • Type: Boolean
79
80
81       Whether or not to output JSON data, rather than the normal output.
82
83       • In npm pkg set it enables parsing set values with JSON.parse() before
84         saving them to your package.json.
85
86
87       Not supported by all npm commands.
88
89   global
90       • Default: false
91
92       • Type: Boolean
93
94
95       Operates in "global" mode, so that packages are installed into the pre‐
96       fix folder instead of the current working directory. See npm help fold‐
97       ers for more on the differences in behavior.
98
99       • packages are installed into the {prefix}/lib/node_modules folder, in‐
100         stead of the current working directory.
101
102       • bin files are linked to {prefix}/bin
103
104       • man pages are linked to {prefix}/share/man
105
106
107   editor
108       • Default: The EDITOR or VISUAL environment variables, or 'notepad.exe'
109         on Windows, or 'vim' on Unix systems
110
111       • Type: String
112
113
114       The command to run for npm edit and npm config edit.
115
116   location
117       • Default: "user" unless --global is passed, which will also  set  this
118         value to "global"
119
120       • Type: "global", "user", or "project"
121
122
123       When passed to npm config this refers to which config file to use.
124
125       When  set  to  "global"  mode,  packages  are installed into the prefix
126       folder instead of the current working directory. See npm  help  folders
127       for more on the differences in behavior.
128
129       • packages are installed into the {prefix}/lib/node_modules folder, in‐
130         stead of the current working directory.
131
132       • bin files are linked to {prefix}/bin
133
134       • man pages are linked to {prefix}/share/man
135
136
137   long
138       • Default: false
139
140       • Type: Boolean
141
142
143       Show extended information in ls, search, and help-search.
144
145   See Also
146       • npm help folders
147
148       • npm help config
149
150       • npm help package.json
151
152       • npm help npmrc
153
154       • npm help npm
155
156
157
158
159                                September 2022                   NPM-CONFIG(1)
Impressum