Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 479 lines (478 sloc) 10.47 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 .
2bb9ceb @isaacs make doc
isaacs authored
4 .TH "NPM\-CONFIG" "1" "February 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 .
5651cdf @isaacs make doc
isaacs authored
277 .SS "username, _password"
278 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
279 .
280 .SS "proxy"
5651cdf @isaacs make doc
isaacs authored
281 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
282 the proxy server\.
c42fe61 @cliffano Add proxy support
cliffano authored
283 .
284 .P
285 Example:
286 .
9dd1d79 @isaacs make doc
isaacs authored
287 .IP "" 4
288 .
289 .nf
5651cdf @isaacs make doc
isaacs authored
290 proxy = http://user:password@proxy\-server:8080
9dd1d79 @isaacs make doc
isaacs authored
291 .
292 .fi
293 .
294 .IP "" 0
5e36298 @isaacs make doc
isaacs authored
295 .
5651cdf @isaacs make doc
isaacs authored
296 .SS "tag"
297 Default: latest
298 .
299 .P
300 If you ask npm to install a package and don\'t tell it a specific version, then
301 it will install the specified tag\.
302 .
303 .P
304 Note: this has no effect on the npm\-tag(1) command\.
305 .
5e36298 @isaacs make doc
isaacs authored
306 .SS "userconfig"
307 The default user configuration file is process\.env\.HOME+"/\.npmrc"\.
308 .
309 .P
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
310 Note that this must be provided either in the cli or env settings\. Once the
311 userconfig is read, it is irrelevant\.
5e36298 @isaacs make doc
isaacs authored
312 .
313 .SS "globalconfig"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
314 The default global configuration file is resolved based on the location of the
315 node executable\. It is process\.execPath+"/\.\./\.\./etc/npmrc"\. In the canonical
316 NodeJS installation with \fBmake install\fR, this is \fB/usr/local/etc/npmrc\fR\|\. If you
317 put the node binary somewhere else (for instance, if you are using nvm or
318 nave), then it would be resolved relative to that location\.
5e36298 @isaacs make doc
isaacs authored
319 .
320 .P
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
321 Note that this must be provided in the cli, env, or userconfig settings\. Once
322 the globalconfig is read, this parameter is irrelevant\.
5e36298 @isaacs make doc
isaacs authored
323 .
324 .SS "global"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
325 If set to some truish value (for instance, by being the last cli flag or being
326 passed a literal \fBtrue\fR or \fB1\fR), and the \fBnpm config set\fR param is being
327 called, then the new configuration paramater is written global config file\.
328 Otherwise, they are saved to the user config file\.
6f7987b @isaacs Document the 'dev' config
isaacs authored
329 .
330 .SS "dev"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
331 If set to a truish value, then it\'ll install the "devDependencies" as well as
332 "dependencies" when installing a package\.
6f7987b @isaacs Document the 'dev' config
isaacs authored
333 .
334 .P
335 Note that devDependencies are \fIalways\fR installed when linking a package\.
bef47ee @isaacs document "tar" conf
isaacs authored
336 .
337 .SS "tar"
338 Default: env\.TAR or "tar"
339 .
340 .P
341 The name of a GNU\-compatible tar program on your system\.
fcd9f2b @isaacs Document "gzip" config
isaacs authored
342 .
343 .SS "gzip"
3cb1bc0 @isaacs Fix #203. Use the env.GZIPBIN env instead of env.GZIP
isaacs authored
344 Default: env\.GZIPBIN or "gzip"
fcd9f2b @isaacs Document "gzip" config
isaacs authored
345 .
346 .P
347 The name of a GNU\-compatible gzip program on your system\.
8f3ee0c @isaacs document the 'usage' config
isaacs authored
348 .
349 .SS "usage"
350 If set to \fBtrue\fR, then this will tell help to print out the short usage statement
351 instead of the long manpage type thing\.
352 .
353 .P
354 This is set automatically if you invoke help like \fBnpm command \-?\fR\|\.
42b4afa @isaacs make doc
isaacs authored
355 .
356 .SS "viewer"
357 Default: "man"
358 .
359 .P
360 The program to use to view help content\. Set to "woman" to use the emacs troff viewer
361 by that name\.
2881227 @isaacs make doc
isaacs authored
362 .
5651cdf @isaacs make doc
isaacs authored
363 .SS "_exit"
2881227 @isaacs make doc
isaacs authored
364 Default: true
365 .
366 .P
367 Whether or not to exit the process when the command is finished\. When
368 using npm programmatically, it\'s a good idea to set this to \fBfalse\fR
369 explicitly\.
370 .
371 .SS "logfd"
372 Default: Standard Error FD (2)
373 .
374 .P
375 The file descriptor (integer) or stream object where npm will write log
376 messages\.
377 .
378 .P
379 When using npm programmatically, you may want to provide a
380 FileWriteStream, or some other form of WritableStream\.
381 .
382 .SS "outfd"
383 Default: Standard Output FD (1)
384 .
385 .P
386 The file descriptor (integer) or stream object where npm will write
387 "normal" output\. For instance, the \fBls\fR and \fBview\fR commands write their
388 output here\.
389 .
390 .P
391 When using npm programmatically, you may want to provide a
392 FileWriteStream, or some other form of WritableStream\.
393 .
394 .SS "color"
395 Default: true
396 .
397 .P
398 Set to false to disable colorized output\.
399 .
400 .P
401 In versions of node that expose the \fBisatty\fR function, npm will never
402 write colorized output to a non\-terminal file descriptor\.
403 .
404 .SS "tmproot"
405 Default: env\.TMPDIR or "/tmp"
406 .
407 .P
408 The folder where temporary files should be placed\.
409 .
410 .P
411 npm creates a subfolder whenever it is run, and attempts to delete it
412 afterwards\.
413 .
414 .SS "force"
415 Default: false
416 .
417 .P
418 Set to a truish value to force uninstalling packages, even if they have
419 dependents\.
420 .
421 .P
422 Note that setting \fBrecursive\fR is safer, because forcing uninstall can
423 create orphan packages that no longer function properly\.
424 .
425 .SS "editor"
426 Default: env\.EDITOR
427 .
428 .P
429 The program to use to edit files\.
c1791f4 @isaacs make doc
isaacs authored
430 .
431 .SS "listopts"
432 Default: ""
433 .
434 .P
435 A whitespace\-separated list of extra args that are always passed to npm ls
436 .
437 .P
438 For example: \fBlistopts = remote\fR
439 .
440 .P
441 \fBnpm ls\fR
442 .
443 .P
444 The output here will always filter by remote
df152ab @isaacs Add the 'must-install' config, and use it in bundling
isaacs authored
445 .
446 .SS "must\-install"
447 Default: true
448 .
449 .P
450 Set to false to not install over packages that already exist\. By
451 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
452 .
453 .SH "description"
454 Default: true
455 .
456 .P
457 Show the package description in npm ls\.
b6828d5 @isaacs Add --node-version config to override engine checking
isaacs authored
458 .
459 .SH "node\-version"
460 Default: \fBprocess\.version\fR from the node environment
461 .
462 .P
463 An effective version of node to use when checking for "engines"
464 compliance\.
465 .
466 .P
467 Set to null or false to suppress engine checking altogether\.
63b5434 @isaacs Fix #539 Implement configurable "onload-script"
isaacs authored
468 .
469 .SH "onload\-script"
470 Default: false
471 .
472 .P
473 A script to run when npm loads\. Use this to hook into various events in
474 the npm flow in a programmatic way, even when using npm from the command
475 line\.
476 .
477 .P
478 If false, then don\'t do any onload stuff\.
Something went wrong with that request. Please try again.