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\.
354 Default: true on Posix, false on Windows
357 Type: Boolean or \fB"always"\fR
362 If false, never shows colors\. If \fB"always"\fR then always shows colors\.
363 If true, then only prints color codes for tty file descriptors\.
376 A flag to tell test\-harness to run with their coverage options enabled,
377 if they respond to the \fBnpm_config_coverage\fR environment variable\.
390 The depth to go when recursing directories for \fBnpm ls\fR and \fBnpm cache ls\fR\|\.
403 Show the description in \fBnpm search\fR
416 Install \fBdev\-dependencies\fR along with packages\.
419 Note that \fBdev\-dependencies\fR are also installed if the \fBnpat\fR flag is
425 Default: \fBEDITOR\fR environment variable if set, or \fB"vi"\fR on Posix,
426 or \fB"notepad"\fR on Windows\.
434 The command to run for \fBnpm edit\fR or \fBnpm config edit\fR\|\.
447 If set to true, then npm will stubbornly refuse to install (or even
448 consider installing) any package that claims to not be compatible with
449 the current Node\.js version\.
462 Makes various commands more forceful\.
465 lifecycle script failure does not block progress\.
468 publishing clobbers previously published versions\.
471 skips cache when requesting from the registry\.
474 prevents checks against clobbering non\-npm files\.
489 The "retries" config for the \fBretry\fR module to use when fetching
490 packages from the registry\.
492 .SS "fetch\-retry\-factor"
503 The "factor" config for the \fBretry\fR module to use when fetching
506 .SS "fetch\-retry\-mintimeout"
509 Default: 10000 (10 seconds)
517 The "minTimeout" config for the \fBretry\fR module to use when fetching
520 .SS "fetch\-retry\-maxtimeout"
523 Default: 60000 (1 minute)
531 The "maxTimeout" config for the \fBretry\fR module to use when fetching
545 The command to use for git commands\. If git is installed on the
546 computer, but is not in the \fBPATH\fR, then set this to the full path to
560 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\.
563 packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the
564 current working directory\.
567 bin files are linked to \fB{prefix}/bin\fR
570 man pages are linked to \fB{prefix}/share/man\fR
577 Default: {prefix}/etc/npmrc
585 The config file to read for global config options\.
587 .SS "globalignorefile"
590 Default: {prefix}/etc/npmignore
598 The config file to read for global ignore patterns to apply to all users
602 If not found, but there is a "gitignore" file in the
603 same directory, then that will be used instead\.
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
622 Default: the \fBHTTPS_PROXY\fR or \fBhttps_proxy\fR or \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variables\.
630 A proxy to use for outgoing https requests\.
635 Default: node/{process\.version} {process\.platform} {process\.arch}
643 Sets a User\-Agent to the request header
656 A white\-space separated list of glob patterns of files to always exclude
657 from packages when building tarballs\.
662 Default: ~/\.npm\-init\.js
670 A module that will be loaded by the \fBnpm init\fR command\. See the
671 documentation for the init\-package\-json \fIhttps://github\.com/isaacs/init\-package\-json\fR module
672 npm help for more information, or npm\-init\.
685 The value \fBnpm init\fR should use by default for the package version\.
687 .SS "init\.author\.name"
698 The value \fBnpm init\fR should use by default for the package author\'s name\.
700 .SS "init\.author\.email"
711 The value \fBnpm init\fR should use by default for the package author\'s email\.
713 .SS "init\.author\.url"
724 The value \fBnpm init\fR should use by default for the package author\'s homepage\.
729 Default: "BSD\-2\-Clause"
737 The value \fBnpm init\fR should use by default for the package license\.
750 Whether or not to output JSON data, rather than the normal output\.
753 This feature is currently experimental, and the output data structures
754 for many commands is either not implemented in JSON yet, or subject to
755 change\. Only the output from \fBnpm ls \-\-json\fR is currently valid\.
768 If true, then local installs will link if there is a suitable globally
772 Note that this means that local installs can cause things to be
773 installed into the global space at the same time\. The link is only done
774 if one of the two conditions are met:
777 The package is not already installed globally, or
780 the globally installed version is identical to the version that is
781 being installed locally\.
794 Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly"
799 What level of logs to report\. On failure, \fIall\fR logs are written to \fBnpm\-debug\.log\fR in the current working directory\.
802 Any logs of a higher level than the setting are shown\.
803 The default is "http", which shows http, warn, and error output\.
808 Default: process\.stderr
816 This is the stream that is passed to the npmlog \fIhttps://github\.com/isaacs/npmlog\fR module at run time\.
819 It cannot be set from the command line, but if you are using npm
820 programmatically, you may wish to send logs to somewhere other than
824 If the \fBcolor\fR config is set to true, then this stream will receive
825 colored output if it is a TTY\.
838 Show extended information in \fBnpm ls\fR
851 Commit message which is used by \fBnpm version\fR when creating version commit\.
854 Any "%s" in the message will be replaced with the version number\.
859 Default: process\.version
862 Type: semver or false
867 The node version to use when checking package\'s "engines" hash\.
880 Run tests on installation and report results to the \fBnpaturl\fR\|\.
885 Default: Not yet implemented
893 The url to report npat test results\.
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\.
1343 .SS "userignorefile"
1346 Default: ~/\.npmignore
1354 The location of a user\-level ignore file to apply to all packages\.
1357 If not found, but there is a \.gitignore file in the same directory, then
1358 that will be used instead\.
1366 Type: Octal numeric string
1371 The "umask" value to use when setting the file creation mode on files
1375 Folders and executables are given a mode which is \fB0777\fR masked against
1376 this value\. Other files are given a mode which is \fB0666\fR masked against
1377 this value\. Thus, the defaults are \fB0755\fR and \fB0644\fR respectively\.
1390 If true, output the npm version and exit successfully\.
1393 Only relevant when specified explicitly on the command line\.
1406 If true, output the npm version as well as node\'s \fBprocess\.versions\fR
1407 hash, and exit successfully\.
1410 Only relevant when specified explicitly on the command line\.
1415 Default: "man" on Posix, "browser" on Windows
1423 The program to use to view help content\.
1426 Set to \fB"browser"\fR to view html help content in the default web browser\.
1434 Type: Boolean or null
1439 If set to \fBnull\fR, then prompt the user for responses in some
1443 If set to \fBtrue\fR, then answer "yes" to any prompt\. If set to \fBfalse\fR
1444 then answer "no" to any prompt\.