1 .\" Generated with Ronnjs 0.3.8
2 .\" http://github.com/kapouer/ronnjs/
4 .TH "NPM\-CONFIG" "7" "November 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\.
737 Whether or not to output JSON data, rather than the normal output\.
740 This feature is currently experimental, and the output data structures
741 for many commands is either not implemented in JSON yet, or subject to
742 change\. Only the output from \fBnpm ls \-\-json\fR is currently valid\.
755 If true, then local installs will link if there is a suitable globally
759 Note that this means that local installs can cause things to be
760 installed into the global space at the same time\. The link is only done
761 if one of the two conditions are met:
764 The package is not already installed globally, or
767 the globally installed version is identical to the version that is
768 being installed locally\.
781 Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly"
786 What level of logs to report\. On failure, \fIall\fR logs are written to \fBnpm\-debug\.log\fR in the current working directory\.
789 Any logs of a higher level than the setting are shown\.
790 The default is "http", which shows http, warn, and error output\.
795 Default: process\.stderr
803 This is the stream that is passed to the npmlog \fIhttps://github\.com/isaacs/npmlog\fR module at run time\.
806 It cannot be set from the command line, but if you are using npm
807 programmatically, you may wish to send logs to somewhere other than
811 If the \fBcolor\fR config is set to true, then this stream will receive
812 colored output if it is a TTY\.
825 Show extended information in \fBnpm ls\fR
838 Commit message which is used by \fBnpm version\fR when creating version commit\.
841 Any "%s" in the message will be replaced with the version number\.
846 Default: process\.version
849 Type: semver or false
854 The node version to use when checking package\'s "engines" hash\.
867 Run tests on installation and report results to the \fBnpaturl\fR\|\.
872 Default: Not yet implemented
880 The url to report npat test results\.
893 A node module to \fBrequire()\fR when npm loads\. Useful for programmatic
907 Attempt to install packages in the \fBoptionalDependencies\fR hash\. Note
908 that if these packages fail to install, the overall installation
909 process is not aborted\.
922 Output parseable results from commands that write to
928 npm help Default: see npm\-folders
936 The location to install global items\. If set on the command line, then
937 it forces non\-global commands to run in the specified folder\.
950 Set to true to run in "production" mode\.
953 devDependencies are not installed at the topmost level when running
954 local \fBnpm install\fR without any arguments\.
957 Set the NODE_ENV="production" for lifecycle scripts\.
961 .SS "proprietary\-attribs"
972 Whether or not to include proprietary extended attributes in the
973 tarballs created by npm\.
976 Unless you are expecting to unpack package tarballs with something other
977 than npm \-\- particularly a very outdated tar implementation \-\- leave
983 Default: \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variable, or null
991 A proxy to use for outgoing http requests\.
993 .SS "rebuild\-bundle"
1004 Rebuild bundled dependencies after installation\.
1009 Default: https://registry\.npmjs\.org/
1017 The base URL of the npm package registry\.
1030 Remove failed installs\.
1043 Save installed packages to a package\.json file as dependencies\.
1046 When used with the \fBnpm rm\fR command, it removes it from the dependencies
1050 Only works if there is already a package\.json file present\.
1063 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\.
1066 When used with the \fBnpm rm\fR command, it removes it from the
1067 bundledDependencies list\.
1080 Save installed packages to a package\.json file as devDependencies\.
1083 When used with the \fBnpm rm\fR command, it removes it from the devDependencies
1087 Only works if there is already a package\.json file present\.
1089 .SS "save\-optional"
1100 Save installed packages to a package\.json file as optionalDependencies\.
1103 When used with the \fBnpm rm\fR command, it removes it from the devDependencies
1107 Only works if there is already a package\.json file present\.
1120 Space\-separated options that are always passed to search\.
1133 Space\-separated options that limit the results from search\.
1144 Values: "name", "\-name", "date", "\-date", "description",
1145 "\-description", "keywords", "\-keywords"
1150 Indication of which field to sort search results by\. Prefix with a \fB\-\fR
1151 character to indicate reverse sort\.
1156 Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
1165 The shell to run for the \fBnpm explore\fR command\.
1178 If set to false, then ignore \fBnpm\-shrinkwrap\.json\fR files when
1181 .SS "sign\-git\-tag"
1192 If set to true, then the \fBnpm version\fR command will tag the version
1193 using \fB\-s\fR to add a signature\.
1196 Note that git requires you to have set up GPG keys in your git configs
1197 for this to work properly\.
1210 Whether or not to do SSL key validation when making requests to the
1211 registry via https\.
1214 See also the \fBca\fR config\.
1227 If you ask npm to install a package and don\'t tell it a specific version, then
1228 it will install the specified tag\.
1231 Also the tag that is added to the package@version specified by the \fBnpm
1232 tag\fR command, if no explicit tag is given\.
1237 Default: TMPDIR environment variable, or "/tmp"
1245 Where to store temporary files and folders\. All temp files are deleted
1246 on success, but left behind on failure for forensic purposes\.
1259 When set to true, npm uses unicode characters in the tree output\. When
1260 false, it uses ascii characters to draw trees\.
1265 Default: false if running as root, true otherwise
1273 Set to true to suppress the UID/GID switching when running package
1274 scripts\. If set explicitly to false, then installing as a non\-root user
1288 Set to show short usage output (like the \-H output)
1289 npm help instead of complete help when doing \fBnpm\-help\fR\|\.
1297 Type: String or Number
1302 The UID to set to when running package scripts as root\.
1315 The username on the npm registry\. Set with \fBnpm adduser\fR
1328 The location of user\-level configuration settings\.
1330 .SS "userignorefile"
1333 Default: ~/\.npmignore
1341 The location of a user\-level ignore file to apply to all packages\.
1344 If not found, but there is a \.gitignore file in the same directory, then
1345 that will be used instead\.
1353 Type: Octal numeric string
1358 The "umask" value to use when setting the file creation mode on files
1362 Folders and executables are given a mode which is \fB0777\fR masked against
1363 this value\. Other files are given a mode which is \fB0666\fR masked against
1364 this value\. Thus, the defaults are \fB0755\fR and \fB0644\fR respectively\.
1377 If true, output the npm version and exit successfully\.
1380 Only relevant when specified explicitly on the command line\.
1393 If true, output the npm version as well as node\'s \fBprocess\.versions\fR
1394 hash, and exit successfully\.
1397 Only relevant when specified explicitly on the command line\.
1402 Default: "man" on Posix, "browser" on Windows
1410 The program to use to view help content\.
1413 Set to \fB"browser"\fR to view html help content in the default web browser\.
1421 Type: Boolean or null
1426 If set to \fBnull\fR, then prompt the user for responses in some
1430 If set to \fBtrue\fR, then answer "yes" to any prompt\. If set to \fBfalse\fR
1431 then answer "no" to any prompt\.