1 .\" Generated with Ronnjs 0.3.8
2 .\" http://github.com/kapouer/ronnjs/
4 .TH "NPM\-CONFIG" "7" "December 2013" "" ""
7 \fBnpm-config\fR \-\- More than you probably want to know about npm configuration
10 npm gets its configuration values from 6 sources, in this priority:
12 .SS "Command Line Flags"
13 Putting \fB\-\-foo bar\fR on the command line sets the \fBfoo\fR configuration
14 parameter to \fB"bar"\fR\|\. A \fB\-\-\fR argument tells the cli parser to stop
15 reading flags\. A \fB\-\-flag\fR parameter that is at the \fIend\fR of the
16 command will be given the value of \fBtrue\fR\|\.
18 .SS "Environment Variables"
19 Any environment variables that start with \fBnpm_config_\fR will be
20 interpreted as a configuration parameter\. For example, putting \fBnpm_config_foo=bar\fR in your environment will set the \fBfoo\fR
21 configuration parameter to \fBbar\fR\|\. Any environment configurations that
22 are not given a value will be given the value of \fBtrue\fR\|\. Config
23 values are case\-insensitive, so \fBNPM_CONFIG_FOO=bar\fR will work the
27 The three relevant files are:
30 per\-user config file (~/\.npmrc)
33 global config file ($PREFIX/npmrc)
36 npm builtin config file (/path/to/npm/npmrc)
41 npm help See npmrc for more details\.
44 A set of configuration parameters that are internal to npm, and are
45 defaults if nothing else is specified\.
47 .SH "Shorthands and Other CLI Niceties"
48 The following shorthands are parsed on the command\-line:
51 \fB\-v\fR: \fB\-\-version\fR
54 \fB\-h\fR, \fB\-?\fR, \fB\-\-help\fR, \fB\-H\fR: \fB\-\-usage\fR
57 \fB\-s\fR, \fB\-\-silent\fR: \fB\-\-loglevel silent\fR
60 \fB\-q\fR, \fB\-\-quiet\fR: \fB\-\-loglevel warn\fR
63 \fB\-d\fR: \fB\-\-loglevel info\fR
66 \fB\-dd\fR, \fB\-\-verbose\fR: \fB\-\-loglevel verbose\fR
69 \fB\-ddd\fR: \fB\-\-loglevel silly\fR
72 \fB\-g\fR: \fB\-\-global\fR
75 \fB\-l\fR: \fB\-\-long\fR
78 \fB\-m\fR: \fB\-\-message\fR
81 \fB\-p\fR, \fB\-\-porcelain\fR: \fB\-\-parseable\fR
84 \fB\-reg\fR: \fB\-\-registry\fR
87 \fB\-v\fR: \fB\-\-version\fR
90 \fB\-f\fR: \fB\-\-force\fR
93 \fB\-desc\fR: \fB\-\-description\fR
96 \fB\-S\fR: \fB\-\-save\fR
99 \fB\-D\fR: \fB\-\-save\-dev\fR
102 \fB\-O\fR: \fB\-\-save\-optional\fR
105 \fB\-B\fR: \fB\-\-save\-bundle\fR
108 \fB\-y\fR: \fB\-\-yes\fR
111 \fB\-n\fR: \fB\-\-yes false\fR
114 \fBll\fR and \fBla\fR commands: \fBls \-\-long\fR
119 If the specified configuration param resolves unambiguously to a known
120 configuration parameter, then it is expanded to that configuration
121 parameter\. For example:
135 If multiple single\-character shorthands are strung together, and the
136 resulting combination is unambiguously not some other configuration
137 param, then it is expanded to its various component pieces\. For
145 npm ls \-\-global \-\-parseable \-\-long \-\-loglevel info
151 .SH "Per\-Package Config Settings"
152 When running scripts (npm help see \fBnpm\-scripts\fR) the package\.json "config"
153 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
160 , "config" : { "port" : "8080" }
161 , "scripts" : { "start" : "node server\.js" } }
168 and the server\.js is this:
173 http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port)
180 then the user could change the behavior by doing:
185 npm config set foo:port 80
192 npm help See package\.json for more information\.
194 .SH "Config Settings"
207 Force npm to always require authentication when accessing the registry,
208 even for \fBGET\fR requests\.
221 Tells npm to create symlinks (or \fB\|\.cmd\fR shims on Windows) for package
225 Set to false to have it not do this\. This can be used to work around
226 the fact that some file systems don\'t support symlinks, even on
227 ostensibly Unix systems\.
232 Default: OS X: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg\-open"\fR
240 The browser that is called by the \fBnpm docs\fR command to open websites\.
245 Default: The npm CA certificate
253 The Certificate Authority signing certificate that is trusted for SSL
254 connections to the registry\.
257 Set to \fBnull\fR to only allow "known" registrars, or to a specific CA cert
258 to trust only that specific signing authority\.
261 See also the \fBstrict\-ssl\fR config\.
266 Default: Windows: \fB%AppData%\\npm\-cache\fR, Posix: \fB~/\.npm\fR
274 npm help The location of npm\'s cache directory\. See \fBnpm\-cache\fR
276 .SS "cache\-lock\-stale"
279 Default: 60000 (1 minute)
287 The number of ms before cache folder lockfiles are considered stale\.
289 .SS "cache\-lock\-retries"
300 Number of times to retry to acquire a lock on cache folder lockfiles\.
302 .SS "cache\-lock\-wait"
305 Default: 10000 (10 seconds)
313 Number of ms to wait for cache lock files to expire\.
326 The maximum time (in seconds) to keep items in the registry cache before
327 re\-checking against the registry\.
330 Note that no purging is done unless the \fBnpm cache clean\fR command is
331 explicitly used, and that only GET requests use the cache\.
344 The minimum time (in seconds) to keep items in the registry cache before
345 re\-checking against the registry\.
348 Note that no purging is done unless the \fBnpm cache clean\fR command is
349 explicitly used, and that only GET requests use the cache\.
362 A client certificate to pass when accessing the registry\.
367 Default: true on Posix, false on Windows
370 Type: Boolean or \fB"always"\fR
375 If false, never shows colors\. If \fB"always"\fR then always shows colors\.
376 If true, then only prints color codes for tty file descriptors\.
389 The depth to go when recursing directories for \fBnpm ls\fR and \fBnpm cache ls\fR\|\.
402 Show the description in \fBnpm search\fR
415 Install \fBdev\-dependencies\fR along with packages\.
418 Note that \fBdev\-dependencies\fR are also installed if the \fBnpat\fR flag is
424 Default: \fBEDITOR\fR environment variable if set, or \fB"vi"\fR on Posix,
425 or \fB"notepad"\fR on Windows\.
433 The command to run for \fBnpm edit\fR or \fBnpm config edit\fR\|\.
436 The email of the logged\-in user\.
439 Set by the \fBnpm adduser\fR command\. Should not be set explicitly\.
452 If set to true, then npm will stubbornly refuse to install (or even
453 consider installing) any package that claims to not be compatible with
454 the current Node\.js version\.
467 Makes various commands more forceful\.
470 lifecycle script failure does not block progress\.
473 publishing clobbers previously published versions\.
476 skips cache when requesting from the registry\.
479 prevents checks against clobbering non\-npm files\.
494 The "retries" config for the \fBretry\fR module to use when fetching
495 packages from the registry\.
497 .SS "fetch\-retry\-factor"
508 The "factor" config for the \fBretry\fR module to use when fetching
511 .SS "fetch\-retry\-mintimeout"
514 Default: 10000 (10 seconds)
522 The "minTimeout" config for the \fBretry\fR module to use when fetching
525 .SS "fetch\-retry\-maxtimeout"
528 Default: 60000 (1 minute)
536 The "maxTimeout" config for the \fBretry\fR module to use when fetching
550 The command to use for git commands\. If git is installed on the
551 computer, but is not in the \fBPATH\fR, then set this to the full path to
554 .SS "git\-tag\-version"
565 Tag the commit when using the \fBnpm version\fR command\.
578 npm help Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory\. See \fBnpm\-folders\fR for more on the differences in behavior\.
581 packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the
582 current working directory\.
585 bin files are linked to \fB{prefix}/bin\fR
588 man pages are linked to \fB{prefix}/share/man\fR
595 Default: {prefix}/etc/npmrc
603 The config file to read for global config options\.
608 Default: GID of the current process
611 Type: String or Number
616 The group to use when running package scripts in global mode as the root
630 The string that starts all the debugging log output\.
635 Default: the \fBHTTPS_PROXY\fR or \fBhttps_proxy\fR or \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variables\.
643 A proxy to use for outgoing https requests\.
645 .SS "ignore\-scripts"
656 If true, npm does not run scripts specified in package\.json files\.
661 Default: ~/\.npm\-init\.js
669 A module that will be loaded by the \fBnpm init\fR command\. See the
670 documentation for the init\-package\-json \fIhttps://github\.com/isaacs/init\-package\-json\fR module
671 npm help for more information, or npm\-init\.
673 .SS "init\.author\.name"
684 The value \fBnpm init\fR should use by default for the package author\'s name\.
686 .SS "init\.author\.email"
697 The value \fBnpm init\fR should use by default for the package author\'s email\.
699 .SS "init\.author\.url"
710 The value \fBnpm init\fR should use by default for the package author\'s homepage\.
715 Default: "BSD\-2\-Clause"
723 The value \fBnpm init\fR should use by default for the package license\.
736 Whether or not to output JSON data, rather than the normal output\.
739 This feature is currently experimental, and the output data structures
740 for many commands is either not implemented in JSON yet, or subject to
741 change\. Only the output from \fBnpm ls \-\-json\fR is currently valid\.
754 A client key to pass when accessing the registry\.
767 If true, then local installs will link if there is a suitable globally
771 Note that this means that local installs can cause things to be
772 installed into the global space at the same time\. The link is only done
773 if one of the two conditions are met:
776 The package is not already installed globally, or
779 the globally installed version is identical to the version that is
780 being installed locally\.
795 The IP address of the local interface to use when making connections
796 to the npm registry\. Must be IPv4 in versions of Node prior to 0\.12\.
807 Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly"
812 What level of logs to report\. On failure, \fIall\fR logs are written to \fBnpm\-debug\.log\fR in the current working directory\.
815 Any logs of a higher level than the setting are shown\.
816 The default is "http", which shows http, warn, and error output\.
821 Default: process\.stderr
829 This is the stream that is passed to the npmlog \fIhttps://github\.com/isaacs/npmlog\fR module at run time\.
832 It cannot be set from the command line, but if you are using npm
833 programmatically, you may wish to send logs to somewhere other than
837 If the \fBcolor\fR config is set to true, then this stream will receive
838 colored output if it is a TTY\.
851 Show extended information in \fBnpm ls\fR
864 Commit message which is used by \fBnpm version\fR when creating version commit\.
867 Any "%s" in the message will be replaced with the version number\.
872 Default: process\.version
875 Type: semver or false
880 The node version to use when checking package\'s "engines" hash\.
893 Run tests on installation\.
906 A node module to \fBrequire()\fR when npm loads\. Useful for programmatic
920 Attempt to install packages in the \fBoptionalDependencies\fR hash\. Note
921 that if these packages fail to install, the overall installation
922 process is not aborted\.
935 Output parseable results from commands that write to
941 npm help Default: see npm\-folders
949 The location to install global items\. If set on the command line, then
950 it forces non\-global commands to run in the specified folder\.
963 Set to true to run in "production" mode\.
966 devDependencies are not installed at the topmost level when running
967 local \fBnpm install\fR without any arguments\.
970 Set the NODE_ENV="production" for lifecycle scripts\.
974 .SS "proprietary\-attribs"
985 Whether or not to include proprietary extended attributes in the
986 tarballs created by npm\.
989 Unless you are expecting to unpack package tarballs with something other
990 than npm \-\- particularly a very outdated tar implementation \-\- leave
996 Default: \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variable, or null
1004 A proxy to use for outgoing http requests\.
1006 .SS "rebuild\-bundle"
1017 Rebuild bundled dependencies after installation\.
1022 Default: https://registry\.npmjs\.org/
1030 The base URL of the npm package registry\.
1043 Remove failed installs\.
1056 Save installed packages to a package\.json file as dependencies\.
1059 When used with the \fBnpm rm\fR command, it removes it from the dependencies
1063 Only works if there is already a package\.json file present\.
1076 If a package would be saved at install time by the use of \fB\-\-save\fR, \fB\-\-save\-dev\fR, or \fB\-\-save\-optional\fR, then also put it in the \fBbundleDependencies\fR list\.
1079 When used with the \fBnpm rm\fR command, it removes it from the
1080 bundledDependencies list\.
1093 Save installed packages to a package\.json file as devDependencies\.
1096 When used with the \fBnpm rm\fR command, it removes it from the devDependencies
1100 Only works if there is already a package\.json file present\.
1102 .SS "save\-optional"
1113 Save installed packages to a package\.json file as optionalDependencies\.
1116 When used with the \fBnpm rm\fR command, it removes it from the devDependencies
1120 Only works if there is already a package\.json file present\.
1133 Space\-separated options that are always passed to search\.
1146 Space\-separated options that limit the results from search\.
1157 Values: "name", "\-name", "date", "\-date", "description",
1158 "\-description", "keywords", "\-keywords"
1163 Indication of which field to sort search results by\. Prefix with a \fB\-\fR
1164 character to indicate reverse sort\.
1169 Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
1178 The shell to run for the \fBnpm explore\fR command\.
1191 If set to false, then ignore \fBnpm\-shrinkwrap\.json\fR files when
1194 .SS "sign\-git\-tag"
1205 If set to true, then the \fBnpm version\fR command will tag the version
1206 using \fB\-s\fR to add a signature\.
1209 Note that git requires you to have set up GPG keys in your git configs
1210 for this to work properly\.
1223 Whether or not to do SSL key validation when making requests to the
1224 registry via https\.
1227 See also the \fBca\fR config\.
1240 If you ask npm to install a package and don\'t tell it a specific version, then
1241 it will install the specified tag\.
1244 Also the tag that is added to the package@version specified by the \fBnpm
1245 tag\fR command, if no explicit tag is given\.
1250 Default: TMPDIR environment variable, or "/tmp"
1258 Where to store temporary files and folders\. All temp files are deleted
1259 on success, but left behind on failure for forensic purposes\.
1272 When set to true, npm uses unicode characters in the tree output\. When
1273 false, it uses ascii characters to draw trees\.
1278 Default: false if running as root, true otherwise
1286 Set to true to suppress the UID/GID switching when running package
1287 scripts\. If set explicitly to false, then installing as a non\-root user
1301 Set to show short usage output (like the \-H output)
1302 npm help instead of complete help when doing \fBnpm\-help\fR\|\.
1310 Type: String or Number
1315 The UID to set to when running package scripts as root\.
1328 The username on the npm registry\. Set with \fBnpm adduser\fR
1341 The location of user\-level configuration settings\.
1349 Type: Octal numeric string
1354 The "umask" value to use when setting the file creation mode on files
1358 Folders and executables are given a mode which is \fB0777\fR masked against
1359 this value\. Other files are given a mode which is \fB0666\fR masked against
1360 this value\. Thus, the defaults are \fB0755\fR and \fB0644\fR respectively\.
1365 Default: node/{process\.version} {process\.platform} {process\.arch}
1373 Sets a User\-Agent to the request header
1386 If true, output the npm version and exit successfully\.
1389 Only relevant when specified explicitly on the command line\.
1402 If true, output the npm version as well as node\'s \fBprocess\.versions\fR
1403 hash, and exit successfully\.
1406 Only relevant when specified explicitly on the command line\.
1411 Default: "man" on Posix, "browser" on Windows
1419 The program to use to view help content\.
1422 Set to \fB"browser"\fR to view html help content in the default web browser\.