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