Skip to content
This repository
tag: v1.0.0rc5
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 782 lines (781 sloc) 12.278 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
.TH "NPM\-CONFIG" "1" "March 2011" "" ""
.
.SH "NAME"
\fBnpm-config\fR \-\- Manage the npm configuration file
.
.SH "SYNOPSIS"
.
.nf
npm config set <key> <value> [\-\-global]
npm config get <key>
npm config delete <key>
npm config list
npm config edit
npm get <key>
npm set <key> <value> [\-\-global]
.
.fi
.
.SH "DESCRIPTION"
npm gets its configuration values from 5 sources, in this priority:
.
.IP "\(bu" 4
cli:
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
parser to stop reading flags\. A \fB\-\-flag\fR parameter that is at the \fIend\fR of
the command will be given the value of \fBtrue\fR\|\.
.
.IP "\(bu" 4
env:
Any environment variables that start with \fBnpm_config_\fR will be interpreted
as a configuration parameter\. For example, putting \fBnpm_config_foo=bar\fR in
your environment will set the \fBfoo\fR configuration parameter to \fBbar\fR\|\. Any
environment configurations that are not given a value will be given the value
of \fBtrue\fR\|\. Config values are case\-insensitive, so \fBNPM_CONFIG_FOO=bar\fR will
work the same\.
.
.IP "\(bu" 4
$HOME/\.npmrc (or the \fBuserconfig\fR param, if set above):
This file is an ini\-file formatted list of \fBkey = value\fR parameters\.
.
.IP "\(bu" 4
$PREFIX/etc/npmrc (or the \fBglobalconfig\fR param, if set above):
This file is an ini\-file formatted list of \fBkey = value\fR parameters
.
.IP "\(bu" 4
default configs:
This is a set of configuration parameters that are internal to npm, and are
defaults if nothing else is specified\.
.
.IP "" 0
.
.SH "Sub\-commands"
Config supports the following sub\-commands:
.
.SS "set"
.
.nf
npm config set key value
.
.fi
.
.P
Sets the config key to the value\.
.
.P
If value is omitted, then it sets it to "true"\.
.
.SS "get"
.
.nf
npm config get key
.
.fi
.
.P
Echo the config value to stdout\.
.
.SS "list"
.
.nf
npm config list
.
.fi
.
.P
Show all the config settings\.
.
.SS "delete"
.
.nf
npm config delete key
.
.fi
.
.P
Deletes the key from all configuration files\.
.
.SS "edit"
.
.nf
npm config edit
.
.fi
.
.P
Opens the config file in an editor\. Use the \fB\-\-global\fR flag to edit the
global config\.
.
.SH "Shorthands and Other CLI Niceties"
The following shorthands are parsed on the command\-line:
.
.IP "\(bu" 4
\fB\-v\fR: \fB\-\-version\fR
.
.IP "\(bu" 4
\fB\-h\fR, \fB\-?\fR, \fB\-\-help\fR, \fB\-H\fR: \fB\-\-usage\fR
.
.IP "\(bu" 4
\fB\-s\fR, \fB\-\-silent\fR: \fB\-\-loglevel silent\fR
.
.IP "\(bu" 4
\fB\-d\fR: \fB\-\-loglevel info\fR
.
.IP "\(bu" 4
\fB\-dd\fR, \fB\-\-verbose\fR: \fB\-\-loglevel verbose\fR
.
.IP "\(bu" 4
\fB\-ddd\fR: \fB\-\-loglevel silly\fR
.
.IP "\(bu" 4
\fB\-g\fR: \fB\-\-global\fR
.
.IP "\(bu" 4
\fB\-l\fR: \fB\-\-long\fR
.
.IP "\(bu" 4
\fB\-p\fR, \fB\-\-porcelain\fR: \fB\-\-parseable\fR
.
.IP "\(bu" 4
\fB\-reg\fR: \fB\-\-registry\fR
.
.IP "\(bu" 4
\fB\-v\fR: \fB\-\-version\fR
.
.IP "\(bu" 4
\fB\-f\fR: \fB\-\-force\fR
.
.IP "\(bu" 4
\fB\-l\fR: \fB\-\-long\fR
.
.IP "\(bu" 4
\fB\-desc\fR: \fB\-\-description\fR
.
.IP "\(bu" 4
\fBll\fR and \fBla\fR commands: \fBls \-\-long\fR
.
.IP "" 0
.
.P
If the specified configuration param resolves unambiguously to a known
configuration parameter, then it is expanded to that configuration
parameter\. For example:
.
.IP "" 4
.
.nf
npm ls \-\-par
# same as:
npm ls \-\-parseable
.
.fi
.
.IP "" 0
.
.P
If multiple single\-character shorthands are strung together, and the
resulting combination is unambiguously not some other configuration
param, then it is expanded to its various component pieces\. For
example:
.
.IP "" 4
.
.nf
npm ls \-gpld
# same as:
npm ls \-\-global \-\-parseable \-\-long \-\-loglevel info
.
.fi
.
.IP "" 0
.
.SH "Per\-Package Config Settings"
When running scripts (see \fBnpm help scripts\fR)
the package\.json "config" keys are overwritten in the environment if
there is a config param of \fB<name>[@<version>]:<key>\fR\|\. For example, if
the package\.json has this:
.
.IP "" 4
.
.nf
{ "name" : "foo"
, "config" : { "port" : "8080" }
, "scripts" : { "start" : "node server\.js" } }
.
.fi
.
.IP "" 0
.
.P
and the server\.js is this:
.
.IP "" 4
.
.nf
http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port)
.
.fi
.
.IP "" 0
.
.P
then the user could change the behavior by doing:
.
.IP "" 4
.
.nf
npm config set foo:port 80
.
.fi
.
.IP "" 0
.
.SH "Config Settings"
.
.SS "browser"
.
.IP "\(bu" 4
Default: OS X: \fB"open"\fR, others: \fB"google\-chrome"\fR
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
The browser that is called by the \fBnpm docs\fR command to open websites\.
.
.SS "cache"
.
.IP "\(bu" 4
Default: Windows: \fB~/npm\-cache\fR, Posix: \fB~/\.npm\fR
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The location of npm\'s cache directory\. See \fBnpm help cache\fR
.
.SS "color"
.
.IP "\(bu" 4
Default: true
.
.IP "\(bu" 4
Type: Boolean or \fB"always"\fR
.
.IP "" 0
.
.P
If false, never shows colors\. If \fB"always"\fR then always shows colors\.
If true, then only prints color codes for tty file descriptors\.
.
.SS "depth"
.
.IP "\(bu" 4
Default: Infinity
.
.IP "\(bu" 4
Type: Number
.
.IP "" 0
.
.P
The depth to go when recursing directories for \fBnpm ls\fR and \fBnpm cache ls\fR\|\.
.
.SS "description"
.
.IP "\(bu" 4
Default: true
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to show the description in \fBnpm search\fR
.
.SS "dev"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to install \fBdev\-dependencies\fR along with packages\.
.
.P
Note that \fBdev\-dependencies\fR are also installed if the \fBnpat\fR flag is
set\.
.
.SS "editor"
.
.IP "\(bu" 4
Default: \fBEDITOR\fR environment variable if set, or \fB"vi"\fR
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The command to run for \fBnpm edit\fR or \fBnpm config edit\fR\|\.
.
.SS "force"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Makes various commands more forceful\.
.
.IP "\(bu" 4
lifecycle script failure does not block progress\.
.
.IP "\(bu" 4
publishing clobbers previously published versions\.
.
.IP "\(bu" 4
skips cache when requesting from the registry\.
.
.IP "\(bu" 4
prevents checks against clobbering non\-npm files\.
.
.IP "" 0
.
.SS "global"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory\. See \fBnpm help global\fR for more on the differences in behavior\.
.
.IP "\(bu" 4
packages are installed into the \fBprefix/node_modules\fR folder, instead of the
current working directory\.
.
.IP "\(bu" 4
bin files are linked to \fBprefix/bin\fR
.
.IP "\(bu" 4
man pages are linked to \fBprefix/share/man\fR
.
.IP "" 0
.
.SS "globalconfig"
.
.IP "\(bu" 4
Default: {prefix}/etc/npmrc
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The config file to read for global config options\.
.
.SS "group"
.
.IP "\(bu" 4
Default: GID of the current process
.
.IP "\(bu" 4
Type: String or Number
.
.IP "" 0
.
.P
The group to use when running package scripts in global mode as the root
user\.
.
.SS "gzipbin"
.
.IP "\(bu" 4
Default: "gzip"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The gzip binary
.
.SS "logfd"
.
.IP "\(bu" 4
Default: stderr file descriptor
.
.IP "\(bu" 4
Type: Number or Stream
.
.IP "" 0
.
.P
The location to write log output\.
.
.SS "loglevel"
.
.IP "\(bu" 4
Default: "warn"
.
.IP "\(bu" 4
Type: String
.
.IP "\(bu" 4
Values: "silent", "win", "error", "warn", "info", "verbose", "silly"
.
.IP "" 0
.
.P
What level of logs to report\. On failure, \fIall\fR logs are written to \fBnpm\-debug\.log\fR in the current working directory\.
.
.SS "long"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to show extended information in \fBnpm ls\fR
.
.SS "node\-version"
.
.IP "\(bu" 4
Default: process\.version
.
.IP "\(bu" 4
Type: semver
.
.IP "" 0
.
.P
The node version to use when checking package\'s "engines" hash\.
.
.SS "npat"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to run tests on installation and report results to the \fBnpaturl\fR\|\.
.
.SS "npaturl"
.
.IP "\(bu" 4
Default: Not yet implemented
.
.IP "\(bu" 4
Type: url
.
.IP "" 0
.
.P
The url to report npat test results\.
.
.SS "onload\-script"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
A node module to \fBrequire()\fR when npm loads\. Useful for programmatic
usage\.
.
.SS "outfd"
.
.IP "\(bu" 4
Default: standard output file descriptor
.
.IP "\(bu" 4
Type: Number or Stream
.
.IP "" 0
.
.P
Where to write "normal" output\. This has no effect on log output\.
.
.SS "parseable"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Whether or not to output parseable results from commands that write to
standard output\.
.
.SS "prefix"
.
.IP "\(bu" 4
Default: node\'s process\.installPrefix
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The location to install global items\. If set on the command line, then
it forces non\-global commands to run in the specified folder\.
.
.SS "proxy"
.
.IP "\(bu" 4
Default: "HTTP\fIPROXY" or "http\fRproxy" environment variable, or null
.
.IP "\(bu" 4
Type: url
.
.IP "" 0
.
.P
A proxy to use for outgoing http requests\.
.
.SS "rebuild\-bundle"
.
.IP "\(bu" 4
Default: true
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Set to some truish value to rebuild bundled dependencies after
installation\.
.
.SS "registry"
.
.IP "\(bu" 4
Default: https://registry\.npmjs\.org/
.
.IP "\(bu" 4
Type: url
.
.IP "" 0
.
.P
The base URL of the npm package registry\.
.
.SS "searchopts"
.
.IP "\(bu" 4
Default: ""
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
Space\-separated options that are always passed to search\.
.
.SS "searchexclude"
.
.IP "\(bu" 4
Default: ""
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
Space\-separated options that limit the results from search\.
.
.SS "shell"
.
.IP "\(bu" 4
Default: SHELL environment variable, or "bash"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The shell to run for the \fBnpm explore\fR command\.
.
.SS "tag"
.
.IP "\(bu" 4
Default: latest
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
If you ask npm to install a package and don\'t tell it a specific version, then
it will install the specified tag\.
.
.P
Also the tag that is added to the package@version specified by the \fBnpm
tag\fR command, if no explicit tag is given\.
.
.SS "tar"
.
.IP "\(bu" 4
Default: TAR environment variable, or "tar"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The tar executable
.
.SS "tmp"
.
.IP "\(bu" 4
Default: TMPDIR environment variable, or "/tmp"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
Where to store temporary files and folders\. All temp files are deleted
on success, but left behind on failure for forensic purposes\.
.
.SS "unsafe\-perm"
.
.IP "\(bu" 4
Default: false if running as root, true otherwise
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Set to true to suppress the UID/GID switching when running package
scripts\. If set explicitly to false, then installing as a non\-root user
will fail\.
.
.SS "usage"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
Set to show short usage output (like the \-H output)
instead of complete help when doing \fBnpm help\fR\|\.
.
.SS "user"
.
.IP "\(bu" 4
Default: "nobody"
.
.IP "\(bu" 4
Type: String or Number
.
.IP "" 0
.
.P
The UID to set to when running package scripts as root\.
.
.SS "username"
.
.IP "\(bu" 4
Default: null
.
.IP "\(bu" 4
Type: String
.
.IP "" 0
.
.P
The username on the npm registry\. Set with \fBnpm adduser\fR
.
.SS "userconfig"
.
.IP "\(bu" 4
Default: ~/\.npmrc on Posix, or ~/npm\-config on Windows
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The location of user\-level configuration settings\.
.
.SS "version"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: boolean
.
.IP "" 0
.
.P
If true, output the npm version and exit successfully\.
.
.P
Only relevant when specified explicitly on the command line\.
.
.SS "viewer"
.
.IP "\(bu" 4
Default: "man"
.
.IP "\(bu" 4
Type: path
.
.IP "" 0
.
.P
The program to use to view help content\.
Something went wrong with that request. Please try again.