Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 473 lines (472 sloc) 10.482 kB
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
1 .\" Generated with Ronnjs/v0.1
2 .\" http://github.com/kapouer/ronnjs/
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
3 .
76a635f @isaacs Add a rebuild-bundle config for Bryan
isaacs authored
4 .TH "NPM\-CONFIG" "1" "January 2011" "" ""
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
5 .
6 .SH "NAME"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
7 \fBnpm-config\fR \-\- Manage the npm configuration file
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
8 .
9 .SH "SYNOPSIS"
10 .
11 .nf
5e36298 @isaacs make doc
isaacs authored
12 npm config set <key> <value> [\-\-global]
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
13 npm config get <key>
14 npm config delete <key>
15 npm config list
8a5eaa6 @isaacs document config edit
isaacs authored
16 npm config edit
9796e7b @isaacs Alias set/get docs to config
isaacs authored
17 npm get <key>
18 npm set <key> <value> [\-\-global]
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
19 .
20 .fi
21 .
22 .SH "DESCRIPTION"
5e36298 @isaacs make doc
isaacs authored
23 npm gets its configuration values from 5 sources, in this priority:
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
24 .
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
25 .IP "\(bu" 4
26 cli:
27 The command line flags\. Putting \fB\-\-foo bar\fR on the command line sets the \fBfoo\fR configuration parameter to \fB"bar"\fR\|\. A \fB\-\-\fR argument tells the cli
28 parser to stop reading flags\. A \fB\-\-flag\fR parameter that is at the \fIend\fR of
29 the command will be given the value of \fBtrue\fR\|\.
30 .
31 .IP "\(bu" 4
32 env:
33 Any environment variables that start with \fBnpm_config_\fR will be interpreted
34 as a configuration parameter\. For example, putting \fBnpm_config_foo=bar\fR in
35 your environment will set the \fBfoo\fR configuration parameter to \fBbar\fR\|\. Any
36 environment configurations that are not given a value will be given the value
37 of \fBtrue\fR\|\. Config values are case\-insensitive, so \fBNPM_CONFIG_FOO=bar\fR will
38 work the same\.
39 .
40 .IP "\(bu" 4
41 $HOME/\.npmrc (or the \fBuserconfig\fR param, if set above):
5e36298 @isaacs make doc
isaacs authored
42 This file is an ini\-file formatted list of \fBkey = value\fR parameters\.
43 .
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
44 .IP "\(bu" 4
45 $PREFIX/etc/npmrc (or the \fBglobalconfig\fR param, if set above):
5e36298 @isaacs make doc
isaacs authored
46 This file is an ini\-file formatted list of \fBkey = value\fR parameters
47 .
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
48 .IP "\(bu" 4
49 default configs:
50 This is a set of configuration parameters that are internal to npm, and are
51 defaults if nothing else is specified\.
52 .
53 .IP "" 0
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
54 .
55 .SH "Sub\-commands"
56 Config supports the following sub\-commands:
57 .
58 .SS "set"
59 .
60 .nf
61 npm config set key value
62 .
63 .fi
64 .
65 .P
e937a72 @isaacs Update all man pages using new version of ronn
isaacs authored
66 Sets the config key to the value\.
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
67 .
68 .SS "get"
69 .
70 .nf
71 npm config get key
72 .
73 .fi
74 .
75 .P
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
76 Echo the config value to stdout\. (NOTE: All the other npm logging is done to
77 stderr, so pipes should work properly, and you can do \fBnpm get key 2>/dev/null\fR
78 to print out JUST the config value\.)
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
79 .
80 .SS "list"
81 .
82 .nf
83 npm config list
84 .
85 .fi
86 .
87 .P
e937a72 @isaacs Update all man pages using new version of ronn
isaacs authored
88 Show all the config settings\.
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
89 .
90 .SS "delete"
91 .
92 .nf
93 npm config delete key
94 .
95 .fi
96 .
97 .P
5e36298 @isaacs make doc
isaacs authored
98 Deletes the key from all configuration files\.
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
99 .
8a5eaa6 @isaacs document config edit
isaacs authored
100 .SS "edit"
101 .
102 .nf
103 npm config edit
104 .
105 .fi
106 .
107 .P
108 Opens the config file in an editor\. Use the \fB\-\-global\fR flag to edit the global config\.
109 .
39985c8 @isaacs make doc
isaacs authored
110 .SH "Per\-Package Config Settings"
111 When running scripts (see \fBnpm help scripts\fR)
112 the package\.json "config" keys are overwritten in the environment if
113 there is a config param of \fB<name>[@<version>]:<key>\fR\|\. For example, if
114 the package\.json has this:
115 .
116 .IP "" 4
117 .
118 .nf
119 { "name" : "foo"
120 , "config" : { "port" : "8080" }
121 , "scripts" : { "start" : "node server\.js" } }
122 .
123 .fi
124 .
125 .IP "" 0
126 .
127 .P
128 and the server\.js is this:
129 .
130 .IP "" 4
131 .
132 .nf
133 http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port)
134 .
135 .fi
136 .
137 .IP "" 0
138 .
139 .P
140 then the user could change the behavior by doing:
141 .
142 .IP "" 4
143 .
144 .nf
145 npm config set foo:port 80
146 .
147 .fi
148 .
149 .IP "" 0
150 .
57729b7 @isaacs Documentation updates
isaacs authored
151 .SH "Config Settings"
152 .
5651cdf @isaacs make doc
isaacs authored
153 .SS "auto\-activate"
154 Default: true
57729b7 @isaacs Documentation updates
isaacs authored
155 .
156 .P
5651cdf @isaacs make doc
isaacs authored
157 Automatically activate a package after installation, if there is not an active
158 version already\. Set to "always" to always activate when installing\.
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
159 .
76a635f @isaacs Add a rebuild-bundle config for Bryan
isaacs authored
160 .SS "rebuild\-bundle"
161 Default: true
162 .
163 .P
164 Set to some truish value to rebuild bundled dependencies after
165 installation\.
166 .
2881227 @isaacs make doc
isaacs authored
167 .SS "recursive"
168 Default: false
169 .
170 .P
171 Set to some truish value to recursively remove dependent packages\. For
172 example if foo depends on bar, and bar depends on baz, then:
173 .
174 .IP "" 4
175 .
176 .nf
177 npm uninstall baz \-\-recursive
178 .
179 .fi
180 .
181 .IP "" 0
182 .
183 .P
184 will remove baz, bar, and foo\.
185 .
4ff3ddf @isaacs Docs for loglevel conf setting.
isaacs authored
186 .SS "loglevel"
187 Default: "info"
188 .
189 .P
329a996 @isaacs Make doc (new version of ronn)
isaacs authored
190 The log level to show\.
191 .
192 .P
193 Each level maps to a numeric value, above which all logs must pass to be
194 seen\. So, setting it to "warn" shows "win", "error" and "warn" messages\.
195 .
196 .P
197 The log levels:
198 .
199 .IP "\(bu" 4
200 silent: Show no output\. Nothing\. If there is output on stderr, it\'s
201 because something is broken\.
202 .
203 .IP "\(bu" 4
204 win: Show the "npm ok" or "npm not ok", but that\'s all\.
205 .
206 .IP "\(bu" 4
207 error: Errors, usually with a stack trace\.
208 .
209 .IP "\(bu" 4
210 warn: Things that you should probably be aware of\.
211 .
212 .IP "\(bu" 4
213 info: Helpful info\.
214 .
215 .IP "\(bu" 4
216 silly: Not\-helpful info\. (Lots of dumping whole objects and such\.)
217 .
218 .IP "" 0
219 .
220 .P
221 Note that output to stdout is always printed\. This setting just modifies
222 what\'s logged to stderr\.
4ff3ddf @isaacs Docs for loglevel conf setting.
isaacs authored
223 .
a0eb2fa @isaacs Rename auto-update to update-dependents, and update docs to reflect this
isaacs authored
224 .SS "update\-dependents"
225 Default: true
226 .
227 .P
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
228 Automatically update a package\'s dependencies after installation, if it is the
229 newest version installed\. Set to "always" to update dependents when a new
230 version is installed, even if it\'s not the newest\.
a0eb2fa @isaacs Rename auto-update to update-dependents, and update docs to reflect this
isaacs authored
231 .
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
232 .SS "root"
5e36298 @isaacs make doc
isaacs authored
233 Default: \fB$INSTALL_PREFIX/lib/node\fR
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
234 .
235 .P
e937a72 @isaacs Update all man pages using new version of ronn
isaacs authored
236 The root folder where packages are installed and npm keeps its data\.
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
237 .
57729b7 @isaacs Documentation updates
isaacs authored
238 .SS "binroot"
239 Default: \fB$INSTALL_PREFIX/bin\fR
240 .
241 .P
e937a72 @isaacs Update all man pages using new version of ronn
isaacs authored
242 The folder where executable programs are installed\.
57729b7 @isaacs Documentation updates
isaacs authored
243 .
c1cc130 @isaacs make doc
isaacs authored
244 .P
245 Set to "false" to not install executables
246 .
247 .SS "manroot"
248 Default: $INSTALL_PREFIX/share/man
249 .
250 .P
251 The folder where man pages are installed\.
252 .
253 .P
254 Set to "false" to not install man pages\.
255 .
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
256 .SS "registry"
e937a72 @isaacs Update all man pages using new version of ronn
isaacs authored
257 Default: https://registry\.npmjs\.org/
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
258 .
259 .P
e937a72 @isaacs Update all man pages using new version of ronn
isaacs authored
260 The base URL of the npm package registry\.
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
261 .
4ad295c @isaacs make doc
isaacs authored
262 .SS "_auth"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
263 A base\-64 encoded "user:pass" pair\. This is created by npm\-adduser(1)\.
b70b2a0 @isaacs Add built documentation to project, so that the install doesn't requi…
isaacs authored
264 .
265 .P
57729b7 @isaacs Documentation updates
isaacs authored
266 If your config file is ever corrupted, you can set this manually by doing:
267 .
268 .IP "" 4
269 .
270 .nf
4ad295c @isaacs make doc
isaacs authored
271 npm adduser
57729b7 @isaacs Documentation updates
isaacs authored
272 .
273 .fi
274 .
275 .IP "" 0
276 .
4ad295c @isaacs make doc
isaacs authored
277 .SS "_authCrypt"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
278 If crypto\.Cipher is available, and you have some private keys in \fB$HOME/\.ssh\fR,
279 then npm will encrypt your "\fIauth" config before saving to the \.npmrc file,
280 and will decrypt the "\fRauthCrypt" config when it reads the \.npmrc file\.
57729b7 @isaacs Documentation updates
isaacs authored
281 .
5651cdf @isaacs make doc
isaacs authored
282 .SS "username, _password"
283 Once the configuration is parsed, the \fB_auth\fR config is split into \fBusername\fR and \fB_password\fR\|\. This is the part before the ":"
c42fe61 @cliffano Add proxy support
cliffano authored
284 .
285 .SS "proxy"
5651cdf @isaacs make doc
isaacs authored
286 If proxy is available, then npm will access the registry via
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
287 the proxy server\.
c42fe61 @cliffano Add proxy support
cliffano authored
288 .
289 .P
290 Example:
291 .
9dd1d79 @isaacs make doc
isaacs authored
292 .IP "" 4
293 .
294 .nf
5651cdf @isaacs make doc
isaacs authored
295 proxy = http://user:password@proxy\-server:8080
9dd1d79 @isaacs make doc
isaacs authored
296 .
297 .fi
298 .
299 .IP "" 0
5e36298 @isaacs make doc
isaacs authored
300 .
5651cdf @isaacs make doc
isaacs authored
301 .SS "tag"
302 Default: latest
303 .
304 .P
305 If you ask npm to install a package and don\'t tell it a specific version, then
306 it will install the specified tag\.
307 .
308 .P
309 Note: this has no effect on the npm\-tag(1) command\.
310 .
5e36298 @isaacs make doc
isaacs authored
311 .SS "userconfig"
312 The default user configuration file is process\.env\.HOME+"/\.npmrc"\.
313 .
314 .P
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
315 Note that this must be provided either in the cli or env settings\. Once the
316 userconfig is read, it is irrelevant\.
5e36298 @isaacs make doc
isaacs authored
317 .
318 .SS "globalconfig"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
319 The default global configuration file is resolved based on the location of the
320 node executable\. It is process\.execPath+"/\.\./\.\./etc/npmrc"\. In the canonical
321 NodeJS installation with \fBmake install\fR, this is \fB/usr/local/etc/npmrc\fR\|\. If you
322 put the node binary somewhere else (for instance, if you are using nvm or
323 nave), then it would be resolved relative to that location\.
5e36298 @isaacs make doc
isaacs authored
324 .
325 .P
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
326 Note that this must be provided in the cli, env, or userconfig settings\. Once
327 the globalconfig is read, this parameter is irrelevant\.
5e36298 @isaacs make doc
isaacs authored
328 .
329 .SS "global"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
330 If set to some truish value (for instance, by being the last cli flag or being
331 passed a literal \fBtrue\fR or \fB1\fR), and the \fBnpm config set\fR param is being
332 called, then the new configuration paramater is written global config file\.
333 Otherwise, they are saved to the user config file\.
6f7987b @isaacs Document the 'dev' config
isaacs authored
334 .
335 .SS "dev"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
336 If set to a truish value, then it\'ll install the "devDependencies" as well as
337 "dependencies" when installing a package\.
6f7987b @isaacs Document the 'dev' config
isaacs authored
338 .
339 .P
340 Note that devDependencies are \fIalways\fR installed when linking a package\.
bef47ee @isaacs document "tar" conf
isaacs authored
341 .
342 .SS "tar"
343 Default: env\.TAR or "tar"
344 .
345 .P
346 The name of a GNU\-compatible tar program on your system\.
fcd9f2b @isaacs Document "gzip" config
isaacs authored
347 .
348 .SS "gzip"
3cb1bc0 @isaacs Fix #203. Use the env.GZIPBIN env instead of env.GZIP
isaacs authored
349 Default: env\.GZIPBIN or "gzip"
fcd9f2b @isaacs Document "gzip" config
isaacs authored
350 .
351 .P
352 The name of a GNU\-compatible gzip program on your system\.
8f3ee0c @isaacs document the 'usage' config
isaacs authored
353 .
354 .SS "usage"
355 If set to \fBtrue\fR, then this will tell help to print out the short usage statement
356 instead of the long manpage type thing\.
357 .
358 .P
359 This is set automatically if you invoke help like \fBnpm command \-?\fR\|\.
42b4afa @isaacs make doc
isaacs authored
360 .
361 .SS "viewer"
362 Default: "man"
363 .
364 .P
365 The program to use to view help content\. Set to "woman" to use the emacs troff viewer
366 by that name\.
2881227 @isaacs make doc
isaacs authored
367 .
5651cdf @isaacs make doc
isaacs authored
368 .SS "_exit"
2881227 @isaacs make doc
isaacs authored
369 Default: true
370 .
371 .P
372 Whether or not to exit the process when the command is finished\. When
373 using npm programmatically, it\'s a good idea to set this to \fBfalse\fR
374 explicitly\.
375 .
376 .SS "logfd"
377 Default: Standard Error FD (2)
378 .
379 .P
380 The file descriptor (integer) or stream object where npm will write log
381 messages\.
382 .
383 .P
384 When using npm programmatically, you may want to provide a
385 FileWriteStream, or some other form of WritableStream\.
386 .
387 .SS "outfd"
388 Default: Standard Output FD (1)
389 .
390 .P
391 The file descriptor (integer) or stream object where npm will write
392 "normal" output\. For instance, the \fBls\fR and \fBview\fR commands write their
393 output here\.
394 .
395 .P
396 When using npm programmatically, you may want to provide a
397 FileWriteStream, or some other form of WritableStream\.
398 .
399 .SS "color"
400 Default: true
401 .
402 .P
403 Set to false to disable colorized output\.
404 .
405 .P
406 In versions of node that expose the \fBisatty\fR function, npm will never
407 write colorized output to a non\-terminal file descriptor\.
408 .
409 .SS "tmproot"
410 Default: env\.TMPDIR or "/tmp"
411 .
412 .P
413 The folder where temporary files should be placed\.
414 .
415 .P
416 npm creates a subfolder whenever it is run, and attempts to delete it
417 afterwards\.
418 .
419 .SS "force"
420 Default: false
421 .
422 .P
423 Set to a truish value to force uninstalling packages, even if they have
424 dependents\.
425 .
426 .P
427 Note that setting \fBrecursive\fR is safer, because forcing uninstall can
428 create orphan packages that no longer function properly\.
429 .
430 .SS "editor"
431 Default: env\.EDITOR
432 .
433 .P
434 The program to use to edit files\.
c1791f4 @isaacs make doc
isaacs authored
435 .
436 .SS "listopts"
437 Default: ""
438 .
439 .P
440 A whitespace\-separated list of extra args that are always passed to npm ls
441 .
442 .P
443 For example: \fBlistopts = remote\fR
444 .
445 .P
446 \fBnpm ls\fR
447 .
448 .P
449 The output here will always filter by remote
df152ab @isaacs Add the 'must-install' config, and use it in bundling
isaacs authored
450 .
451 .SS "must\-install"
452 Default: true
453 .
454 .P
455 Set to false to not install over packages that already exist\. By
456 default, \fBnpm install foo\fR will fetch and install the latest version of \fBfoo\fR, even if it matches a version already installed\.
5651cdf @isaacs make doc
isaacs authored
457 .
458 .SH "description"
459 Default: true
460 .
461 .P
462 Show the package description in npm ls\.
b6828d5 @isaacs Add --node-version config to override engine checking
isaacs authored
463 .
464 .SH "node\-version"
465 Default: \fBprocess\.version\fR from the node environment
466 .
467 .P
468 An effective version of node to use when checking for "engines"
469 compliance\.
470 .
471 .P
472 Set to null or false to suppress engine checking altogether\.
Something went wrong with that request. Please try again.