1 .TH "NPM\-CONFIG" "7" "October 2016" "" ""
3 \fBnpm-config\fR \- More than you probably want to know about npm configuration
6 npm gets its configuration values from the following sources, sorted by priority:
9 Putting \fB\-\-foo bar\fP on the command line sets the \fBfoo\fP configuration
10 parameter to \fB"bar"\fP\|\. A \fB\-\-\fP argument tells the cli parser to stop
11 reading flags\. A \fB\-\-flag\fP parameter that is at the \fIend\fR of the
12 command will be given the value of \fBtrue\fP\|\.
13 .SS Environment Variables
15 Any environment variables that start with \fBnpm_config_\fP will be
16 interpreted as a configuration parameter\. For example, putting
17 \fBnpm_config_foo=bar\fP in your environment will set the \fBfoo\fP
18 configuration parameter to \fBbar\fP\|\. Any environment configurations that
19 are not given a value will be given the value of \fBtrue\fP\|\. Config
20 values are case\-insensitive, so \fBNPM_CONFIG_FOO=bar\fP will work the
24 The four relevant files are:
27 per\-project configuration file (\fB/path/to/my/project/\.npmrc\fP)
29 per\-user configuration file (defaults to \fB$HOME/\.npmrc\fP; configurable via CLI
30 option \fB\-\-userconfig\fP or environment variable \fB$NPM_CONF_USERCONFIG\fP)
32 global configuration file (defaults to \fB$PREFIX/etc/npmrc\fP; configurable via
33 CLI option \fB\-\-globalconfig\fP or environment variable \fB$NPM_CONF_GLOBALCONFIG\fP)
35 npm's built\-in configuration file (\fB/path/to/npm/npmrc\fP)
39 See npm help 5 npmrc for more details\.
42 A set of configuration parameters that are internal to npm, and are
43 defaults if nothing else is specified\.
44 .SH Shorthands and Other CLI Niceties
46 The following shorthands are parsed on the command\-line:
49 \fB\-v\fP: \fB\-\-version\fP
51 \fB\-h\fP, \fB\-?\fP, \fB\-\-help\fP, \fB\-H\fP: \fB\-\-usage\fP
53 \fB\-s\fP, \fB\-\-silent\fP: \fB\-\-loglevel silent\fP
55 \fB\-q\fP, \fB\-\-quiet\fP: \fB\-\-loglevel warn\fP
57 \fB\-d\fP: \fB\-\-loglevel info\fP
59 \fB\-dd\fP, \fB\-\-verbose\fP: \fB\-\-loglevel verbose\fP
61 \fB\-ddd\fP: \fB\-\-loglevel silly\fP
63 \fB\-g\fP: \fB\-\-global\fP
65 \fB\-C\fP: \fB\-\-prefix\fP
67 \fB\-l\fP: \fB\-\-long\fP
69 \fB\-m\fP: \fB\-\-message\fP
71 \fB\-p\fP, \fB\-\-porcelain\fP: \fB\-\-parseable\fP
73 \fB\-reg\fP: \fB\-\-registry\fP
75 \fB\-f\fP: \fB\-\-force\fP
77 \fB\-desc\fP: \fB\-\-description\fP
79 \fB\-S\fP: \fB\-\-save\fP
81 \fB\-D\fP: \fB\-\-save\-dev\fP
83 \fB\-O\fP: \fB\-\-save\-optional\fP
85 \fB\-B\fP: \fB\-\-save\-bundle\fP
87 \fB\-E\fP: \fB\-\-save\-exact\fP
89 \fB\-y\fP: \fB\-\-yes\fP
91 \fB\-n\fP: \fB\-\-yes false\fP
93 \fBll\fP and \fBla\fP commands: \fBls \-\-long\fP
97 If the specified configuration param resolves unambiguously to a known
98 configuration parameter, then it is expanded to that configuration
99 parameter\. For example:
109 If multiple single\-character shorthands are strung together, and the
110 resulting combination is unambiguously not some other configuration
111 param, then it is expanded to its various component pieces\. For
118 npm ls \-\-global \-\-parseable \-\-long \-\-loglevel info
121 .SH Per\-Package Config Settings
123 When running scripts (see npm help 7 \fBnpm\-scripts\fP) the package\.json "config"
124 keys are overwritten in the environment if there is a config param of
125 \fB<name>[@<version>]:<key>\fP\|\. For example, if the package\.json has
131 , "config" : { "port" : "8080" }
132 , "scripts" : { "start" : "node server\.js" } }
136 and the server\.js is this:
140 http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port)
144 then the user could change the behavior by doing:
148 npm config set foo:port 80
152 See npm help 5 package\.json for more information\.
157 Default: \fBrestricted\fP
163 When publishing scoped packages, the access level defaults to \fBrestricted\fP\|\. If
164 you want your scoped package to be publicly viewable (and installable) set
165 \fB\-\-access=public\fP\|\. The only valid values for \fBaccess\fP are \fBpublic\fP and
166 \fBrestricted\fP\|\. Unscoped packages \fIalways\fR have an access level of \fBpublic\fP\|\.
176 Force npm to always require authentication when accessing the registry,
177 even for \fBGET\fP requests\.
187 Tells npm to create symlinks (or \fB\|\.cmd\fP shims on Windows) for package
190 Set to false to have it not do this\. This can be used to work around
191 the fact that some file systems don't support symlinks, even on
192 ostensibly Unix systems\.
196 Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP
202 The browser that is called by the \fBnpm docs\fP command to open websites\.
206 Default: The npm CA certificate
208 Type: String, Array or null
212 The Certificate Authority signing certificate that is trusted for SSL
213 connections to the registry\. Values should be in PEM format with newlines
214 replaced by the string "\\n"\. For example:
218 ca="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-"
222 Set to \fBnull\fP to only allow "known" registrars, or to a specific CA cert
223 to trust only that specific signing authority\.
225 Multiple CAs can be trusted by specifying an array of certificates:
234 See also the \fBstrict\-ssl\fP config\.
244 A path to a file containing one or multiple Certificate Authority signing
245 certificates\. Similar to the \fBca\fP setting, but allows for multiple CA's, as
246 well as for the CA information to be stored in a file on disk\.
250 Default: Windows: \fB%AppData%\\npm\-cache\fP, Posix: \fB~/\.npm\fP
256 The location of npm's cache directory\. See npm help \fBnpm\-cache\fP
257 .SS cache\-lock\-stale
260 Default: 60000 (1 minute)
266 The number of ms before cache folder lockfiles are considered stale\.
267 .SS cache\-lock\-retries
276 Number of times to retry to acquire a lock on cache folder lockfiles\.
277 .SS cache\-lock\-wait
280 Default: 10000 (10 seconds)
286 Number of ms to wait for cache lock files to expire\.
296 The maximum time (in seconds) to keep items in the registry cache before
297 re\-checking against the registry\.
299 Note that no purging is done unless the \fBnpm cache clean\fP command is
300 explicitly used, and that only GET requests use the cache\.
310 The minimum time (in seconds) to keep items in the registry cache before
311 re\-checking against the registry\.
313 Note that no purging is done unless the \fBnpm cache clean\fP command is
314 explicitly used, and that only GET requests use the cache\.
324 A client certificate to pass when accessing the registry\. Values should be in
325 PEM format with newlines replaced by the string "\\n"\. For example:
329 cert="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-"
333 It is \fInot\fR the path to a certificate file (and there is no "certfile" option)\.
339 Type: Boolean or \fB"always"\fP
343 If false, never shows colors\. If \fB"always"\fP then always shows colors\.
344 If true, then only prints color codes for tty file descriptors\.
354 The depth to go when recursing directories for \fBnpm ls\fP,
355 \fBnpm cache ls\fP, and \fBnpm outdated\fP\|\.
357 For \fBnpm outdated\fP, a setting of \fBInfinity\fP will be treated as \fB0\fP
358 since that gives more useful information\. To show the outdated status
359 of all packages and dependents, use a large integer value,
360 e\.g\., \fBnpm outdated \-\-depth 9999\fP
370 Show the description in \fBnpm search\fP
380 Install \fBdev\-dependencies\fP along with packages\.
382 Note that \fBdev\-dependencies\fP are also installed if the \fBnpat\fP flag is
387 Default: \fBEDITOR\fP environment variable if set, or \fB"vi"\fP on Posix,
388 or \fB"notepad"\fP on Windows\.
394 The command to run for \fBnpm edit\fP or \fBnpm config edit\fP\|\.
404 If set to true, then npm will stubbornly refuse to install (or even
405 consider installing) any package that claims to not be compatible with
406 the current Node\.js version\.
416 Makes various commands more forceful\.
419 lifecycle script failure does not block progress\.
421 publishing clobbers previously published versions\.
423 skips cache when requesting from the registry\.
425 prevents checks against clobbering non\-npm files\.
437 The "retries" config for the \fBretry\fP module to use when fetching
438 packages from the registry\.
439 .SS fetch\-retry\-factor
448 The "factor" config for the \fBretry\fP module to use when fetching
450 .SS fetch\-retry\-mintimeout
453 Default: 10000 (10 seconds)
459 The "minTimeout" config for the \fBretry\fP module to use when fetching
461 .SS fetch\-retry\-maxtimeout
464 Default: 60000 (1 minute)
470 The "maxTimeout" config for the \fBretry\fP module to use when fetching
481 The command to use for git commands\. If git is installed on the
482 computer, but is not in the \fBPATH\fP, then set this to the full path to
484 .SS git\-tag\-version
493 Tag the commit when using the \fBnpm version\fP command\.
503 Operates in "global" mode, so that packages are installed into the
504 \fBprefix\fP folder instead of the current working directory\. See
505 npm help 5 \fBnpm\-folders\fP for more on the differences in behavior\.
508 packages are installed into the \fB{prefix}/lib/node_modules\fP folder, instead of the
509 current working directory\.
511 bin files are linked to \fB{prefix}/bin\fP
513 man pages are linked to \fB{prefix}/share/man\fP
519 Default: {prefix}/etc/npmrc
525 The config file to read for global config options\.
529 Default: GID of the current process
531 Type: String or Number
535 The group to use when running package scripts in global mode as the root
546 The string that starts all the debugging log output\.
556 A proxy to use for outgoing https requests\. If the \fBHTTPS_PROXY\fP or
557 \fBhttps_proxy\fP or \fBHTTP_PROXY\fP or \fBhttp_proxy\fP environment variables are set,
558 proxy settings will be honored by the underlying \fBrequest\fP library\.
568 If true, npm will not exit with an error code when \fBrun\-script\fP is invoked for
569 a script that isn't defined in the \fBscripts\fP section of \fBpackage\.json\fP\|\. This
570 option can be used when it's desirable to optionally run a script when it's
571 present and fail if the script fails\. This is useful, for example, when running
572 scripts that may only apply for some builds in an otherwise generic CI setup\.
582 If true, npm does not run scripts specified in package\.json files\.
586 Default: ~/\.npm\-init\.js
592 A module that will be loaded by the \fBnpm init\fP command\. See the
593 documentation for the
594 init\-package\-json \fIhttps://github\.com/isaacs/init\-package\-json\fR module
595 for more information, or npm help init\.
596 .SS init\-author\-name
605 The value \fBnpm init\fP should use by default for the package author's name\.
606 .SS init\-author\-email
615 The value \fBnpm init\fP should use by default for the package author's email\.
616 .SS init\-author\-url
625 The value \fBnpm init\fP should use by default for the package author's homepage\.
635 The value \fBnpm init\fP should use by default for the package license\.
645 The value that \fBnpm init\fP should use by default for the package
646 version number, if not already set in package\.json\.
656 Whether or not to output JSON data, rather than the normal output\.
658 This feature is currently experimental, and the output data structures
659 for many commands is either not implemented in JSON yet, or subject to
660 change\. Only the output from \fBnpm ls \-\-json\fP is currently valid\.
670 A client key to pass when accessing the registry\. Values should be in PEM
671 format with newlines replaced by the string "\\n"\. For example:
675 key="\-\-\-\-\-BEGIN PRIVATE KEY\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END PRIVATE KEY\-\-\-\-\-"
679 It is \fInot\fR the path to a key file (and there is no "keyfile" option)\.
689 If true, then local installs will link if there is a suitable globally
692 Note that this means that local installs can cause things to be
693 installed into the global space at the same time\. The link is only done
694 if one of the two conditions are met:
697 The package is not already installed globally, or
699 the globally installed version is identical to the version that is
700 being installed locally\.
712 The IP address of the local interface to use when making connections
713 to the npm registry\. Must be IPv4 in versions of Node prior to 0\.12\.
721 Values: "silent", "error", "warn", "http", "info", "verbose", "silly"
725 What level of logs to report\. On failure, \fIall\fR logs are written to
726 \fBnpm\-debug\.log\fP in the current working directory\.
728 Any logs of a higher level than the setting are shown\.
729 The default is "warn", which shows warn and error output\.
733 Default: process\.stderr
739 This is the stream that is passed to the
740 npmlog \fIhttps://github\.com/npm/npmlog\fR module at run time\.
742 It cannot be set from the command line, but if you are using npm
743 programmatically, you may wish to send logs to somewhere other than
746 If the \fBcolor\fP config is set to true, then this stream will receive
747 colored output if it is a TTY\.
757 Show extended information in \fBnpm ls\fP and \fBnpm search\fP\|\.
767 The maximum number of connections to use per origin (protocol/host/port
768 combination)\. Passed to the \fBhttp\fP \fBAgent\fP used to make the request\.
778 Commit message which is used by \fBnpm version\fP when creating version commit\.
780 Any "%s" in the message will be replaced with the version number\.
784 Default: process\.version
786 Type: semver or false
790 The node version to use when checking a package's \fBengines\fP map\.
800 Run tests on installation\.
810 A node module to \fBrequire()\fP when npm loads\. Useful for programmatic
821 Attempt to install packages in the \fBoptionalDependencies\fP object\. Note
822 that if these packages fail to install, the overall installation
823 process is not aborted\.
833 Output parseable results from commands that write to
838 Default: see npm help 5 folders
844 The location to install global items\. If set on the command line, then
845 it forces non\-global commands to run in the specified folder\.
855 Set to true to run in "production" mode\.
858 devDependencies are not installed at the topmost level when running
859 local \fBnpm install\fP without any arguments\.
861 Set the NODE_ENV="production" for lifecycle scripts\.
864 .SS proprietary\-attribs
873 Whether or not to include proprietary extended attributes in the
874 tarballs created by npm\.
876 Unless you are expecting to unpack package tarballs with something other
877 than npm \-\- particularly a very outdated tar implementation \-\- leave
888 A proxy to use for outgoing http requests\. If the \fBHTTP_PROXY\fP or
889 \fBhttp_proxy\fP environment variables are set, proxy settings will be
890 honored by the underlying \fBrequest\fP library\.
900 Rebuild bundled dependencies after installation\.
904 Default: https://registry\.npmjs\.org/
910 The base URL of the npm package registry\.
920 Remove failed installs\.
930 Save installed packages to a package\.json file as dependencies\.
932 When used with the \fBnpm rm\fP command, it removes it from the \fBdependencies\fP
935 Only works if there is already a package\.json file present\.
945 If a package would be saved at install time by the use of \fB\-\-save\fP,
946 \fB\-\-save\-dev\fP, or \fB\-\-save\-optional\fP, then also put it in the
947 \fBbundleDependencies\fP list\.
949 When used with the \fBnpm rm\fP command, it removes it from the
950 bundledDependencies list\.
960 Save installed packages to a package\.json file as \fBdevDependencies\fP\|\.
962 When used with the \fBnpm rm\fP command, it removes it from the
963 \fBdevDependencies\fP object\.
965 Only works if there is already a package\.json file present\.
975 Dependencies saved to package\.json using \fB\-\-save\fP, \fB\-\-save\-dev\fP or
976 \fB\-\-save\-optional\fP will be configured with an exact version rather than
977 using npm's default semver range operator\.
987 Save installed packages to a package\.json file as
988 optionalDependencies\.
990 When used with the \fBnpm rm\fP command, it removes it from the
991 \fBdevDependencies\fP object\.
993 Only works if there is already a package\.json file present\.
1003 Configure how versions of packages installed to a package\.json file via
1004 \fB\-\-save\fP or \fB\-\-save\-dev\fP get prefixed\.
1006 For example if a package has version \fB1\.2\.3\fP, by default its version is
1007 set to \fB^1\.2\.3\fP which allows minor upgrades for that package, but after
1008 \fBnpm config set save\-prefix='~'\fP it would be set to \fB~1\.2\.3\fP which only allows
1019 Associate an operation with a scope for a scoped registry\. Useful when logging
1020 in to a private registry for the first time:
1021 \fBnpm login \-\-scope=@organization \-\-registry=registry\.organization\.com\fP, which
1022 will cause \fB@organization\fP to be mapped to the registry for future installation
1023 of packages specified according to the pattern \fB@organization/package\fP\|\.
1033 Space\-separated options that are always passed to search\.
1043 Space\-separated options that limit the results from search\.
1051 Values: "name", "\-name", "date", "\-date", "description",
1052 "\-description", "keywords", "\-keywords"
1056 Indication of which field to sort search results by\. Prefix with a \fB\-\fP
1057 character to indicate reverse sort\.
1061 Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
1068 The shell to run for the \fBnpm explore\fP command\.
1078 If set to false, then ignore \fBnpm\-shrinkwrap\.json\fP files when
1089 If set to true, then the \fBnpm version\fP command will tag the version
1090 using \fB\-s\fP to add a signature\.
1092 Note that git requires you to have set up GPG keys in your git configs
1093 for this to work properly\.
1099 Type: Boolean or \fB"always"\fP
1103 When set to \fBtrue\fP, npm will display an ascii spinner while it is doing
1104 things, if \fBprocess\.stderr\fP is a TTY\.
1106 Set to \fBfalse\fP to suppress the spinner, or set to \fBalways\fP to output
1107 the spinner even for non\-TTY outputs\.
1117 Whether or not to do SSL key validation when making requests to the
1118 registry via https\.
1120 See also the \fBca\fP config\.
1130 If you ask npm to install a package and don't tell it a specific version, then
1131 it will install the specified tag\.
1133 Also the tag that is added to the package@version specified by the \fBnpm
1134 tag\fP command, if no explicit tag is given\.
1135 .SS tag\-version\-prefix
1144 If set, alters the prefix used when tagging a new version when performing a
1145 version increment using \fBnpm\-version\fP\|\. To remove the prefix altogether, set it
1146 to the empty string: \fB""\fP\|\.
1148 Because other tools may rely on the convention that npm version tags look like
1149 \fBv1\.0\.0\fP, \fIonly use this property if it is absolutely necessary\fR\|\. In
1150 particular, use care when overriding this setting for public packages\.
1154 Default: TMPDIR environment variable, or "/tmp"
1160 Where to store temporary files and folders\. All temp files are deleted
1161 on success, but left behind on failure for forensic purposes\.
1171 When set to true, npm uses unicode characters in the tree output\. When
1172 false, it uses ascii characters to draw trees\.
1176 Default: false if running as root, true otherwise
1182 Set to true to suppress the UID/GID switching when running package
1183 scripts\. If set explicitly to false, then installing as a non\-root user
1194 Set to show short usage output (like the \-H output)
1195 instead of complete help when doing npm help \fBnpm\-help\fP\|\.
1201 Type: String or Number
1205 The UID to set to when running package scripts as root\.
1215 The location of user\-level configuration settings\.
1221 Type: Octal numeric string in range 0000\.\.0777 (0\.\.511)
1225 The "umask" value to use when setting the file creation mode on files
1228 Folders and executables are given a mode which is \fB0777\fP masked against
1229 this value\. Other files are given a mode which is \fB0666\fP masked against
1230 this value\. Thus, the defaults are \fB0755\fP and \fB0644\fP respectively\.
1234 Default: node/{process\.version} {process\.platform} {process\.arch}
1240 Sets a User\-Agent to the request header
1250 If true, output the npm version and exit successfully\.
1252 Only relevant when specified explicitly on the command line\.
1262 If true, output the npm version as well as node's \fBprocess\.versions\fP map, and
1265 Only relevant when specified explicitly on the command line\.
1269 Default: "man" on Posix, "browser" on Windows
1275 The program to use to view help content\.
1277 Set to \fB"browser"\fP to view html help content in the default web browser\.