1 .TH "NPM\-CONFIG" "7" "April 2015" "" ""
3 \fBnpm-config\fR \- More than you probably want to know about npm configuration
6 npm gets its configuration values from 6 sources, in this priority:
9 Putting \fB\-\-foo bar\fR on the command line sets the \fBfoo\fR configuration
10 parameter to \fB"bar"\fR\|\. A \fB\-\-\fR argument tells the cli parser to stop
11 reading flags\. A \fB\-\-flag\fR parameter that is at the \fIend\fR of the
12 command will be given the value of \fBtrue\fR\|\.
13 .SS Environment Variables
15 Any environment variables that start with \fBnpm_config_\fR will be
16 interpreted as a configuration parameter\. For example, putting
17 \fBnpm_config_foo=bar\fR in your environment will set the \fBfoo\fR
18 configuration parameter to \fBbar\fR\|\. Any environment configurations that
19 are not given a value will be given the value of \fBtrue\fR\|\. Config
20 values are case\-insensitive, so \fBNPM_CONFIG_FOO=bar\fR will work the
24 The four relevant files are:
27 per\-project config file (/path/to/my/project/\.npmrc)
29 per\-user config file (~/\.npmrc)
31 global config file ($PREFIX/npmrc)
33 npm builtin config file (/path/to/npm/npmrc)
37 See npm help 5 npmrc for more details\.
40 A set of configuration parameters that are internal to npm, and are
41 defaults if nothing else is specified\.
42 .SH Shorthands and Other CLI Niceties
44 The following shorthands are parsed on the command\-line:
47 \fB\-v\fR: \fB\-\-version\fR
49 \fB\-h\fR, \fB\-?\fR, \fB\-\-help\fR, \fB\-H\fR: \fB\-\-usage\fR
51 \fB\-s\fR, \fB\-\-silent\fR: \fB\-\-loglevel silent\fR
53 \fB\-q\fR, \fB\-\-quiet\fR: \fB\-\-loglevel warn\fR
55 \fB\-d\fR: \fB\-\-loglevel info\fR
57 \fB\-dd\fR, \fB\-\-verbose\fR: \fB\-\-loglevel verbose\fR
59 \fB\-ddd\fR: \fB\-\-loglevel silly\fR
61 \fB\-g\fR: \fB\-\-global\fR
63 \fB\-C\fR: \fB\-\-prefix\fR
65 \fB\-l\fR: \fB\-\-long\fR
67 \fB\-m\fR: \fB\-\-message\fR
69 \fB\-p\fR, \fB\-\-porcelain\fR: \fB\-\-parseable\fR
71 \fB\-reg\fR: \fB\-\-registry\fR
73 \fB\-f\fR: \fB\-\-force\fR
75 \fB\-desc\fR: \fB\-\-description\fR
77 \fB\-S\fR: \fB\-\-save\fR
79 \fB\-D\fR: \fB\-\-save\-dev\fR
81 \fB\-O\fR: \fB\-\-save\-optional\fR
83 \fB\-B\fR: \fB\-\-save\-bundle\fR
85 \fB\-E\fR: \fB\-\-save\-exact\fR
87 \fB\-y\fR: \fB\-\-yes\fR
89 \fB\-n\fR: \fB\-\-yes false\fR
91 \fBll\fR and \fBla\fR commands: \fBls \-\-long\fR
95 If the specified configuration param resolves unambiguously to a known
96 configuration parameter, then it is expanded to that configuration
97 parameter\. For example:
107 If multiple single\-character shorthands are strung together, and the
108 resulting combination is unambiguously not some other configuration
109 param, then it is expanded to its various component pieces\. For
116 npm ls \-\-global \-\-parseable \-\-long \-\-loglevel info
119 .SH Per\-Package Config Settings
121 When running scripts (see npm help 7 \fBnpm\-scripts\fR) the package\.json "config"
122 keys are overwritten in the environment if there is a config param of
123 \fB<name>[@<version>]:<key>\fR\|\. For example, if the package\.json has
129 , "config" : { "port" : "8080" }
130 , "scripts" : { "start" : "node server\.js" } }
134 and the server\.js is this:
138 http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port)
142 then the user could change the behavior by doing:
146 npm config set foo:port 80
150 See npm help 5 package\.json for more information\.
155 Default: \fBrestricted\fR
161 When publishing scoped packages, the access level defaults to \fBrestricted\fR\|\. If
162 you want your scoped package to be publicly viewable (and installable) set
163 \fB\-\-access=public\fR\|\. The only valid values for \fBaccess\fR are \fBpublic\fR and
164 \fBrestricted\fR\|\. Unscoped packages \fIalways\fR have an access level of \fBpublic\fR\|\.
174 Force npm to always require authentication when accessing the registry,
175 even for \fBGET\fR requests\.
185 Tells npm to create symlinks (or \fB\|\.cmd\fR shims on Windows) for package
188 Set to false to have it not do this\. This can be used to work around
189 the fact that some file systems don't support symlinks, even on
190 ostensibly Unix systems\.
194 Default: OS X: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg\-open"\fR
200 The browser that is called by the \fBnpm docs\fR command to open websites\.
204 Default: The npm CA certificate
206 Type: String, Array or null
210 The Certificate Authority signing certificate that is trusted for SSL
211 connections to the registry\. Values should be in PEM format with newlines
212 replaced by the string "\\n"\. For example:
216 ca="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-"
220 Set to \fBnull\fR to only allow "known" registrars, or to a specific CA cert
221 to trust only that specific signing authority\.
223 Multiple CAs can be trusted by specifying an array of certificates:
232 See also the \fBstrict\-ssl\fR config\.
242 A path to a file containing one or multiple Certificate Authority signing
243 certificates\. Similar to the \fBca\fR setting, but allows for multiple CA's, as
244 well as for the CA information to be stored in a file on disk\.
248 Default: Windows: \fB%AppData%\\npm\-cache\fR, Posix: \fB~/\.npm\fR
254 The location of npm's cache directory\. See npm help \fBnpm\-cache\fR
255 .SS cache\-lock\-stale
258 Default: 60000 (1 minute)
264 The number of ms before cache folder lockfiles are considered stale\.
265 .SS cache\-lock\-retries
274 Number of times to retry to acquire a lock on cache folder lockfiles\.
275 .SS cache\-lock\-wait
278 Default: 10000 (10 seconds)
284 Number of ms to wait for cache lock files to expire\.
294 The maximum time (in seconds) to keep items in the registry cache before
295 re\-checking against the registry\.
297 Note that no purging is done unless the \fBnpm cache clean\fR command is
298 explicitly used, and that only GET requests use the cache\.
308 The minimum time (in seconds) to keep items in the registry cache before
309 re\-checking against the registry\.
311 Note that no purging is done unless the \fBnpm cache clean\fR command is
312 explicitly used, and that only GET requests use the cache\.
322 A client certificate to pass when accessing the registry\.
326 Default: true on Posix, false on Windows
328 Type: Boolean or \fB"always"\fR
332 If false, never shows colors\. If \fB"always"\fR then always shows colors\.
333 If true, then only prints color codes for tty file descriptors\.
343 The depth to go when recursing directories for \fBnpm ls\fR,
344 \fBnpm cache ls\fR, and \fBnpm outdated\fR\|\.
346 For \fBnpm outdated\fR, a setting of \fBInfinity\fR will be treated as \fB0\fR
347 since that gives more useful information\. To show the outdated status
348 of all packages and dependents, use a large integer value,
349 e\.g\., \fBnpm outdated \-\-depth 9999\fR
359 Show the description in \fBnpm search\fR
369 Install \fBdev\-dependencies\fR along with packages\.
371 Note that \fBdev\-dependencies\fR are also installed if the \fBnpat\fR flag is
376 Default: \fBEDITOR\fR environment variable if set, or \fB"vi"\fR on Posix,
377 or \fB"notepad"\fR on Windows\.
383 The command to run for \fBnpm edit\fR or \fBnpm config edit\fR\|\.
393 If set to true, then npm will stubbornly refuse to install (or even
394 consider installing) any package that claims to not be compatible with
395 the current Node\.js version\.
405 Makes various commands more forceful\.
408 lifecycle script failure does not block progress\.
410 publishing clobbers previously published versions\.
412 skips cache when requesting from the registry\.
414 prevents checks against clobbering non\-npm files\.
426 The "retries" config for the \fBretry\fR module to use when fetching
427 packages from the registry\.
428 .SS fetch\-retry\-factor
437 The "factor" config for the \fBretry\fR module to use when fetching
439 .SS fetch\-retry\-mintimeout
442 Default: 10000 (10 seconds)
448 The "minTimeout" config for the \fBretry\fR module to use when fetching
450 .SS fetch\-retry\-maxtimeout
453 Default: 60000 (1 minute)
459 The "maxTimeout" config for the \fBretry\fR module to use when fetching
470 The command to use for git commands\. If git is installed on the
471 computer, but is not in the \fBPATH\fR, then set this to the full path to
473 .SS git\-tag\-version
482 Tag the commit when using the \fBnpm version\fR command\.
492 Operates in "global" mode, so that packages are installed into the
493 \fBprefix\fR folder instead of the current working directory\. See
494 npm help 5 \fBnpm\-folders\fR for more on the differences in behavior\.
497 packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the
498 current working directory\.
500 bin files are linked to \fB{prefix}/bin\fR
502 man pages are linked to \fB{prefix}/share/man\fR
508 Default: {prefix}/etc/npmrc
514 The config file to read for global config options\.
518 Default: GID of the current process
520 Type: String or Number
524 The group to use when running package scripts in global mode as the root
535 The string that starts all the debugging log output\.
545 A proxy to use for outgoing https requests\. If the \fBHTTPS_PROXY\fR or
546 \fBhttps_proxy\fR or \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variables are set,
547 proxy settings will be honored by the underlying \fBrequest\fR library\.
557 If true, npm will not exit with an error code when \fBrun\-script\fR is invoked for
558 a script that isn't defined in the \fBscripts\fR section of \fBpackage\.json\fR\|\. This
559 option can be used when it's desirable to optionally run a script when it's
560 present and fail if the script fails\. This is useful, for example, when running
561 scripts that may only apply for some builds in an otherwise generic CI setup\.
571 If true, npm does not run scripts specified in package\.json files\.
575 Default: ~/\.npm\-init\.js
581 A module that will be loaded by the \fBnpm init\fR command\. See the
582 documentation for the
583 init\-package\-json \fIhttps://github\.com/isaacs/init\-package\-json\fR module
584 for more information, or npm help init\.
585 .SS init\-author\-name
594 The value \fBnpm init\fR should use by default for the package author's name\.
595 .SS init\-author\-email
604 The value \fBnpm init\fR should use by default for the package author's email\.
605 .SS init\-author\-url
614 The value \fBnpm init\fR should use by default for the package author's homepage\.
624 The value \fBnpm init\fR should use by default for the package license\.
634 The value that \fBnpm init\fR should use by default for the package
635 version number, if not already set in package\.json\.
645 Whether or not to output JSON data, rather than the normal output\.
647 This feature is currently experimental, and the output data structures
648 for many commands is either not implemented in JSON yet, or subject to
649 change\. Only the output from \fBnpm ls \-\-json\fR is currently valid\.
659 A client key to pass when accessing the registry\.
669 If true, then local installs will link if there is a suitable globally
672 Note that this means that local installs can cause things to be
673 installed into the global space at the same time\. The link is only done
674 if one of the two conditions are met:
677 The package is not already installed globally, or
679 the globally installed version is identical to the version that is
680 being installed locally\.
692 The IP address of the local interface to use when making connections
693 to the npm registry\. Must be IPv4 in versions of Node prior to 0\.12\.
701 Values: "silent", "error", "warn", "http", "info", "verbose", "silly"
705 What level of logs to report\. On failure, \fIall\fR logs are written to
706 \fBnpm\-debug\.log\fR in the current working directory\.
708 Any logs of a higher level than the setting are shown\.
709 The default is "warn", which shows warn and error output\.
713 Default: process\.stderr
719 This is the stream that is passed to the
720 npmlog \fIhttps://github\.com/npm/npmlog\fR module at run time\.
722 It cannot be set from the command line, but if you are using npm
723 programmatically, you may wish to send logs to somewhere other than
726 If the \fBcolor\fR config is set to true, then this stream will receive
727 colored output if it is a TTY\.
737 Show extended information in \fBnpm ls\fR and \fBnpm search\fR\|\.
747 Commit message which is used by \fBnpm version\fR when creating version commit\.
749 Any "%s" in the message will be replaced with the version number\.
753 Default: process\.version
755 Type: semver or false
759 The node version to use when checking a package's \fBengines\fR map\.
769 Run tests on installation\.
779 A node module to \fBrequire()\fR when npm loads\. Useful for programmatic
790 Attempt to install packages in the \fBoptionalDependencies\fR object\. Note
791 that if these packages fail to install, the overall installation
792 process is not aborted\.
802 Output parseable results from commands that write to
807 Default: see npm help 5 folders
813 The location to install global items\. If set on the command line, then
814 it forces non\-global commands to run in the specified folder\.
824 Set to true to run in "production" mode\.
827 devDependencies are not installed at the topmost level when running
828 local \fBnpm install\fR without any arguments\.
830 Set the NODE_ENV="production" for lifecycle scripts\.
833 .SS proprietary\-attribs
842 Whether or not to include proprietary extended attributes in the
843 tarballs created by npm\.
845 Unless you are expecting to unpack package tarballs with something other
846 than npm \-\- particularly a very outdated tar implementation \-\- leave
857 A proxy to use for outgoing http requests\. If the \fBHTTP_PROXY\fR or
858 \fBhttp_proxy\fR environment variables are set, proxy settings will be
859 honored by the underlying \fBrequest\fR library\.
869 Rebuild bundled dependencies after installation\.
873 Default: https://registry\.npmjs\.org/
879 The base URL of the npm package registry\.
889 Remove failed installs\.
899 Save installed packages to a package\.json file as dependencies\.
901 When used with the \fBnpm rm\fR command, it removes it from the \fBdependencies\fR
904 Only works if there is already a package\.json file present\.
914 If a package would be saved at install time by the use of \fB\-\-save\fR,
915 \fB\-\-save\-dev\fR, or \fB\-\-save\-optional\fR, then also put it in the
916 \fBbundleDependencies\fR list\.
918 When used with the \fBnpm rm\fR command, it removes it from the
919 bundledDependencies list\.
929 Save installed packages to a package\.json file as \fBdevDependencies\fR\|\.
931 When used with the \fBnpm rm\fR command, it removes it from the
932 \fBdevDependencies\fR object\.
934 Only works if there is already a package\.json file present\.
944 Dependencies saved to package\.json using \fB\-\-save\fR, \fB\-\-save\-dev\fR or
945 \fB\-\-save\-optional\fR will be configured with an exact version rather than
946 using npm's default semver range operator\.
956 Save installed packages to a package\.json file as
957 optionalDependencies\.
959 When used with the \fBnpm rm\fR command, it removes it from the
960 \fBdevDependencies\fR object\.
962 Only works if there is already a package\.json file present\.
972 Configure how versions of packages installed to a package\.json file via
973 \fB\-\-save\fR or \fB\-\-save\-dev\fR get prefixed\.
975 For example if a package has version \fB1\.2\.3\fR, by default its version is
976 set to \fB^1\.2\.3\fR which allows minor upgrades for that package, but after
977 \fBnpm config set save\-prefix='~'\fR it would be set to \fB~1\.2\.3\fR which only allows
988 Associate an operation with a scope for a scoped registry\. Useful when logging
989 in to a private registry for the first time:
990 \fBnpm login \-\-scope=@organization \-\-registry=registry\.organization\.com\fR, which
991 will cause \fB@organization\fR to be mapped to the registry for future installation
992 of packages specified according to the pattern \fB@organization/package\fR\|\.
1002 Space\-separated options that are always passed to search\.
1012 Space\-separated options that limit the results from search\.
1020 Values: "name", "\-name", "date", "\-date", "description",
1021 "\-description", "keywords", "\-keywords"
1025 Indication of which field to sort search results by\. Prefix with a \fB\-\fR
1026 character to indicate reverse sort\.
1030 Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
1037 The shell to run for the \fBnpm explore\fR command\.
1047 If set to false, then ignore \fBnpm\-shrinkwrap\.json\fR files when
1058 If set to true, then the \fBnpm version\fR command will tag the version
1059 using \fB\-s\fR to add a signature\.
1061 Note that git requires you to have set up GPG keys in your git configs
1062 for this to work properly\.
1068 Type: Boolean or \fB"always"\fR
1072 When set to \fBtrue\fR, npm will display an ascii spinner while it is doing
1073 things, if \fBprocess\.stderr\fR is a TTY\.
1075 Set to \fBfalse\fR to suppress the spinner, or set to \fBalways\fR to output
1076 the spinner even for non\-TTY outputs\.
1086 Whether or not to do SSL key validation when making requests to the
1087 registry via https\.
1089 See also the \fBca\fR config\.
1099 If you ask npm to install a package and don't tell it a specific version, then
1100 it will install the specified tag\.
1102 Also the tag that is added to the package@version specified by the \fBnpm
1103 tag\fR command, if no explicit tag is given\.
1107 Default: TMPDIR environment variable, or "/tmp"
1113 Where to store temporary files and folders\. All temp files are deleted
1114 on success, but left behind on failure for forensic purposes\.
1124 When set to true, npm uses unicode characters in the tree output\. When
1125 false, it uses ascii characters to draw trees\.
1129 Default: false if running as root, true otherwise
1135 Set to true to suppress the UID/GID switching when running package
1136 scripts\. If set explicitly to false, then installing as a non\-root user
1147 Set to show short usage output (like the \-H output)
1148 instead of complete help when doing npm help \fBnpm\-help\fR\|\.
1154 Type: String or Number
1158 The UID to set to when running package scripts as root\.
1168 The location of user\-level configuration settings\.
1174 Type: Octal numeric string in range 0000\.\.0777 (0\.\.511)
1178 The "umask" value to use when setting the file creation mode on files
1181 Folders and executables are given a mode which is \fB0777\fR masked against
1182 this value\. Other files are given a mode which is \fB0666\fR masked against
1183 this value\. Thus, the defaults are \fB0755\fR and \fB0644\fR respectively\.
1187 Default: node/{process\.version} {process\.platform} {process\.arch}
1193 Sets a User\-Agent to the request header
1203 If true, output the npm version and exit successfully\.
1205 Only relevant when specified explicitly on the command line\.
1215 If true, output the npm version as well as node's \fBprocess\.versions\fR map, and
1218 Only relevant when specified explicitly on the command line\.
1222 Default: "man" on Posix, "browser" on Windows
1228 The program to use to view help content\.
1230 Set to \fB"browser"\fR to view html help content in the default web browser\.