1CONFIG(7)                                                            CONFIG(7)
2
3
4

NAME

6       config - More than you probably want to know about npm configuration
7
8   Description
9       npm gets its configuration values from the following sources, sorted by
10       priority:
11
12   Command Line Flags
13       Putting --foo bar on the command line sets the foo configuration param‐
14       eter  to  "bar".   A  --  argument tells the cli parser to stop reading
15       flags.  Using --flag without specifying any value will set the value to
16       true.
17
18       Example:  --flag1  --flag2  will  set  both configuration parameters to
19       true, while --flag1 --flag2 bar will set flag1 to true,  and  flag2  to
20       bar.   Finally,  --flag1 --flag2 -- bar will set both configuration pa‐
21       rameters to true, and the bar is taken as a command argument.
22
23   Environment Variables
24       Any environment variables that start with npm_config_  will  be  inter‐
25       preted  as  a  configuration  parameter.  For example, putting npm_con‐
26       fig_foo=bar in your environment will set the foo configuration  parame‐
27       ter  to bar.  Any environment configurations that are not given a value
28       will be given the value of true.  Config values  are  case-insensitive,
29       so NPM_CONFIG_FOO=bar will work the same. However, please note that in‐
30       side npm help scripts npm will set its own  environment  variables  and
31       Node  will prefer those lowercase versions over any uppercase ones that
32       you     might     set.      For     details     see     this      issue
33       https://github.com/npm/npm/issues/14528.
34
35       Notice  that  you  need  to use underscores instead of dashes, so --al‐
36       low-same-version would become npm_config_allow_same_version=true.
37
38   npmrc Files
39       The four relevant files are:
40
41       • per-project configuration file (/path/to/my/project/.npmrc)
42
43       • per-user configuration file (defaults to  $HOME/.npmrc;  configurable
44         via CLI option --userconfig or environment variable $NPM_CONFIG_USER‐
45         CONFIG)
46
47       • global configuration file  (defaults  to  $PREFIX/etc/npmrc;  config‐
48         urable   via   CLI  option  --globalconfig  or  environment  variable
49         $NPM_CONFIG_GLOBALCONFIG)
50
51       • npm's built-in configuration file (/path/to/npm/npmrc)
52
53
54       See npm help npmrc for more details.
55
56   Default Configs
57       Run npm config ls -l to see a set of configuration parameters that  are
58       internal to npm, and are defaults if nothing else is specified.
59
60   Shorthands and Other CLI Niceties
61       The following shorthands are parsed on the command-line:
62
63-v: --version
64
65-h, -?, --help, -H: --usage
66
67-s, --silent: --loglevel silent
68
69-q, --quiet: --loglevel warn
70
71-d: --loglevel info
72
73-dd, --verbose: --loglevel verbose
74
75-ddd: --loglevel silly
76
77-g: --global
78
79-C: --prefix
80
81-l: --long
82
83-m: --message
84
85-p, --porcelain: --parseable
86
87-reg: --registry
88
89-f: --force
90
91-desc: --description
92
93-S: --save
94
95-P: --save-prod
96
97-D: --save-dev
98
99-O: --save-optional
100
101-B: --save-bundle
102
103-E: --save-exact
104
105-y: --yes
106
107-n: --yes false
108
109ll and la commands: ls --long
110
111
112       If  the specified configuration param resolves unambiguously to a known
113       configuration parameter, then it is expanded to that configuration  pa‐
114       rameter.  For example:
115
116         npm ls --par
117         # same as:
118         npm ls --parseable
119
120       If  multiple  single-character  shorthands are strung together, and the
121       resulting combination is unambiguously  not  some  other  configuration
122       param,  then it is expanded to its various component pieces.  For exam‐
123       ple:
124
125         npm ls -gpld
126         # same as:
127         npm ls --global --parseable --long --loglevel info
128
129   Per-Package Config Settings
130       When running scripts (see npm help scripts) the  package.json  "config"
131       keys  are  overwritten in the environment if there is a config param of
132       <name>[@<version>]:<key>.  For example, if the package.json has this:
133
134         { "name" : "foo"
135         , "config" : { "port" : "8080" }
136         , "scripts" : { "start" : "node server.js" } }
137
138       and the server.js is this:
139
140         http.createServer(...).listen(process.env.npm_package_config_port)
141
142       then the user could change the behavior by doing:
143
144         npm config set foo:port 80
145
146       See npm help package.json for more information.
147
148   Config Settings
149   access
150       • Default: restricted
151
152       • Type: Access
153
154
155       When publishing scoped packages,  the  access  level  defaults  to  re‐
156       stricted.  If you want your scoped package to be publicly viewable (and
157       installable) set --access=public. The only valid values for access  are
158       public and restricted. Unscoped packages always have an access level of
159       public.
160
161   allow-same-version
162       • Default: false
163
164       • Type: Boolean
165
166
167       Prevents throwing an error when npm version is used to set the new ver‐
168       sion to the same value as the current version.
169
170   always-auth
171       • Default: false
172
173       • Type: Boolean
174
175
176       Force npm to always require authentication when accessing the registry,
177       even for GET requests.
178
179   also
180       • Default: null
181
182       • Type: String
183
184
185       When "dev" or "development" and running local npm shrinkwrap, npm  out‐
186       dated, or npm update, is an alias for --dev.
187
188   audit
189       • Default: true
190
191       • Type: Boolean
192
193
194       When  "true" submit audit reports alongside npm install runs to the de‐
195       fault registry and all registries configured for scopes.  See the docu‐
196       mentation for npm help audit for details on what is submitted.
197
198   audit-level
199       • Default: "low"
200
201       • Type: 'low', 'moderate', 'high', 'critical'
202
203
204       The  minimum  level  of  vulnerability  for  npm  audit  to exit with a
205       non-zero exit code.
206
207   auth-type
208       • Default: 'legacy'
209
210       • Type: 'legacy', 'sso', 'saml', 'oauth'
211
212
213       What authentication strategy to use with adduser/login.
214
215   before
216       • Alias: enjoy-by
217
218       • Default: null
219
220       • Type: Date
221
222
223       If passed to npm install, will rebuild the npm tree such that only ver‐
224       sions that were available on or before the --before time get installed.
225       If there's no versions available for the current set of  direct  depen‐
226       dencies, the command will error.
227
228       If  the requested version is a dist-tag and the given tag does not pass
229       the --before filter, the most recent version less than or equal to that
230       tag  will  be  used. For example, foo@latest might install foo@1.2 even
231       though latest is 2.0.
232
233   bin-links
234       • Default: true
235
236       • Type: Boolean
237
238
239       Tells npm to create symlinks (or .cmd shims on Windows) for package ex‐
240       ecutables.
241
242       Set  to  false to have it not do this.  This can be used to work around
243       the fact that some file systems don't support symlinks, even on  osten‐
244       sibly Unix systems.
245
246   browser
247       • Default: OS X: "open", Windows: "start", Others: "xdg-open"
248
249       • Type: String
250
251
252       The browser that is called by the npm docs command to open websites.
253
254   ca
255       • Default: The npm CA certificate
256
257       • Type: String, Array or null
258
259
260       The  Certificate  Authority signing certificate that is trusted for SSL
261       connections to the registry. Values should be in  PEM  format  (Windows
262       calls  it "Base-64 encoded X.509 (.CER)") with newlines replaced by the
263       string "\n". For example:
264
265         ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
266
267       Set to null to only allow "known" registrars, or to a specific CA  cert
268       to trust only that specific signing authority.
269
270       Multiple CAs can be trusted by specifying an array of certificates:
271
272         ca[]="..."
273         ca[]="..."
274
275       See also the strict-ssl config.
276
277   cafile
278       • Default: null
279
280       • Type: path
281
282
283       A path to a file containing one or multiple Certificate Authority sign‐
284       ing certificates. Similar to the ca setting, but  allows  for  multiple
285       CA's, as well as for the CA information to be stored in a file on disk.
286
287   cache
288       • Default: Windows: %AppData%\npm-cache, Posix: ~/.npm
289
290       • Type: path
291
292
293       The location of npm's cache directory.  See npm help cache
294
295   cache-lock-stale
296       • Default: 60000 (1 minute)
297
298       • Type: Number
299
300
301       The number of ms before cache folder lockfiles are considered stale.
302
303   cache-lock-retries
304       • Default: 10
305
306       • Type: Number
307
308
309       Number of times to retry to acquire a lock on cache folder lockfiles.
310
311   cache-lock-wait
312       • Default: 10000 (10 seconds)
313
314       • Type: Number
315
316
317       Number of ms to wait for cache lock files to expire.
318
319   cache-max
320       • Default: Infinity
321
322       • Type: Number
323
324
325       DEPRECATED:  This  option  has been deprecated in favor of --prefer-on‐
326       line.
327
328       --cache-max=0 is an alias for --prefer-online.
329
330   cache-min
331       • Default: 10
332
333       • Type: Number
334
335
336       DEPRECATED: This option has been deprecated in favor  of  --prefer-off‐
337       line.
338
339       --cache-min=9999 (or bigger) is an alias for --prefer-offline.
340
341   cert
342       • Default: null
343
344       • Type: String
345
346
347       A  client  certificate  to  pass  when  accessing the registry.  Values
348       should be in PEM  format  (Windows  calls  it  "Base-64  encoded  X.509
349       (.CER)") with newlines replaced by the string "\n". For example:
350
351         cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
352
353       It  is  not  the path to a certificate file (and there is no "certfile"
354       option).
355
356   cidr
357       • Default: null
358
359       • Type: String, Array, null
360
361
362       This is a list of CIDR address to be used when configuring limited  ac‐
363       cess tokens with the npm token create command.
364
365   color
366       • Default: true
367
368       • Type: Boolean or "always"
369
370
371       If  false,  never  shows colors.  If "always" then always shows colors.
372       If true, then only prints color codes for tty file descriptors.
373
374       This option can also be changed using the environment: colors are  dis‐
375       abled when the environment variable NO_COLOR is set to any value.
376
377   depth
378       • Default: Infinity
379
380       • Type: Number
381
382
383       The  depth  to  go when recursing directories for npm ls, npm cache ls,
384       and npm outdated.
385
386       For npm outdated, a setting of Infinity will be treated as 0 since that
387       gives  more  useful  information.   To  show the outdated status of all
388       packages and dependents, use a large integer value, e.g., npm  outdated
389       --depth 9999
390
391   description
392       • Default: true
393
394       • Type: Boolean
395
396
397       Show the description in npm search
398
399   dev
400       • Default: false
401
402       • Type: Boolean
403
404
405       Install dev-dependencies along with packages.
406
407   dry-run
408       • Default: false
409
410       • Type: Boolean
411
412
413       Indicates  that  you  don't  want  npm  to make any changes and that it
414       should only report what it would have done.  This can  be  passed  into
415       any  of  the commands that modify your local installation, eg, install,
416       update, dedupe, uninstall.  This is NOT currently honored by some  net‐
417       work related commands, eg dist-tags, owner, etc.
418
419   editor
420       • Default:  EDITOR  environment  variable  if set, or "vi" on Posix, or
421         "notepad" on Windows.
422
423       • Type: path
424
425
426       The command to run for npm edit or npm config edit.
427
428   engine-strict
429       • Default: false
430
431       • Type: Boolean
432
433
434       If set to true, then npm will stubbornly refuse  to  install  (or  even
435       consider  installing) any package that claims to not be compatible with
436       the current Node.js version.
437
438   force
439       • Default: false
440
441       • Type: Boolean
442
443
444       Makes various commands more forceful.
445
446       • lifecycle script failure does not block progress.
447
448       • publishing clobbers previously published versions.
449
450       • skips cache when requesting from the registry.
451
452       • prevents checks against clobbering non-npm files.
453
454
455   format-package-lock
456       • Default: true
457
458       • Type: Boolean
459
460
461       Format package-lock.json or npm-shrinkwrap.json  as  a  human  readable
462       file.
463
464   fetch-retries
465       • Default: 2
466
467       • Type: Number
468
469
470       The "retries" config for the retry module to use when fetching packages
471       from the registry.
472
473   fetch-retry-factor
474       • Default: 10
475
476       • Type: Number
477
478
479       The "factor" config for the retry module to use when fetching packages.
480
481   fetch-retry-mintimeout
482       • Default: 10000 (10 seconds)
483
484       • Type: Number
485
486
487       The "minTimeout" config for the retry module to use when fetching pack‐
488       ages.
489
490   fetch-retry-maxtimeout
491       • Default: 60000 (1 minute)
492
493       • Type: Number
494
495
496       The "maxTimeout" config for the retry module to use when fetching pack‐
497       ages.
498
499   fund
500       • Default: true
501
502       • Type: Boolean
503
504
505       When "true" displays the message at the end of  each  npm  install  ac‐
506       knowledging  the  number  of dependencies looking for funding.  See npm
507       help fund for details.
508
509   git
510       • Default: "git"
511
512       • Type: String
513
514
515       The command to use for git commands.  If git is installed on  the  com‐
516       puter,  but  is  not in the PATH, then set this to the full path to the
517       git binary.
518
519   git-tag-version
520       • Default: true
521
522       • Type: Boolean
523
524
525       Tag the commit when using the npm version command.
526
527   commit-hooks
528       • Default: true
529
530       • Type: Boolean
531
532
533       Run git commit hooks when using the npm version command.
534
535   global
536       • Default: false
537
538       • Type: Boolean
539
540
541       Operates in "global" mode, so that packages are installed into the pre‐
542       fix  folder  instead  of  the  current working directory.  See npm help
543       folders for more on the differences in behavior.
544
545       • packages are installed into the {prefix}/lib/node_modules folder, in‐
546         stead of the current working directory.
547
548       • bin files are linked to {prefix}/bin
549
550       • man pages are linked to {prefix}/share/man
551
552
553   globalconfig
554       • Default: {prefix}/etc/npmrc
555
556       • Type: path
557
558
559       The config file to read for global config options.
560
561   global-style
562       • Default: false
563
564       • Type: Boolean
565
566
567       Causes  npm  to install the package into your local node_modules folder
568       with the same layout it uses with the global node_modules folder.  Only
569       your  direct dependencies will show in node_modules and everything they
570       depend on will be flattened in their node_modules folders.  This  obvi‐
571       ously  will  eliminate  some  deduping.  If  used with legacy-bundling,
572       legacy-bundling will be preferred.
573
574   group
575       • Default: GID of the current process
576
577       • Type: String or Number
578
579
580       The group to use when running package scripts in  global  mode  as  the
581       root user.
582
583   heading
584       • Default: "npm"
585
586       • Type: String
587
588
589       The string that starts all the debugging log output.
590
591   https-proxy
592       • Default: null
593
594       • Type: url
595
596
597       A  proxy  to  use  for  outgoing  https requests. If the HTTPS_PROXY or
598       https_proxy or HTTP_PROXY or http_proxy environment variables are  set,
599       proxy settings will be honored by the underlying request library.
600
601   if-present
602       • Default: false
603
604       • Type: Boolean
605
606
607       If  true,  npm  will not exit with an error code when run-script is in‐
608       voked for a script that isn't defined in the scripts section  of  pack‐
609       age.json. This option can be used when it's desirable to optionally run
610       a script when it's present and fail if the script fails. This  is  use‐
611       ful,  for  example,  when  running scripts that may only apply for some
612       builds in an otherwise generic CI setup.
613
614   ignore-prepublish
615       • Default: false
616
617       • Type: Boolean
618
619
620       If true, npm will not run prepublish scripts.
621
622   ignore-scripts
623       • Default: false
624
625       • Type: Boolean
626
627
628       If true, npm does not run scripts specified in package.json files.
629
630   init-module
631       • Default: ~/.npm-init.js
632
633       • Type: path
634
635
636       A module that will be loaded by the npm init command.  See the documen‐
637       tation  for  the init-package-json https://github.com/isaacs/init-pack
638       age-json module for more information, or npm help init.
639
640   init-author-name
641       • Default: ""
642
643       • Type: String
644
645
646       The value npm init should use by default for the package author's name.
647
648   init-author-email
649       • Default: ""
650
651       • Type: String
652
653
654       The value npm init should use  by  default  for  the  package  author's
655       email.
656
657   init-author-url
658       • Default: ""
659
660       • Type: String
661
662
663       The value npm init should use by default for the package author's home‐
664       page.
665
666   init-license
667       • Default: "ISC"
668
669       • Type: String
670
671
672       The value npm init should use by default for the package license.
673
674   init-version
675       • Default: "1.0.0"
676
677       • Type: semver
678
679
680       The value that npm init should use by default for the  package  version
681       number, if not already set in package.json.
682
683   json
684       • Default: false
685
686       • Type: Boolean
687
688
689       Whether or not to output JSON data, rather than the normal output.
690
691       This  feature is currently experimental, and the output data structures
692       for many commands is either not implemented in JSON yet, or subject  to
693       change.   Only  the output from npm ls --json and npm search --json are
694       currently valid.
695
696   key
697       • Default: null
698
699       • Type: String
700
701
702       A client key to pass when accessing the registry.  Values should be  in
703       PEM format with newlines replaced by the string "\n". For example:
704
705         key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
706
707       It is not the path to a key file (and there is no "keyfile" option).
708
709   legacy-bundling
710       • Default: false
711
712       • Type: Boolean
713
714
715       Causes  npm  to  install the package such that versions of npm prior to
716       1.4, such as the one included with node 0.8, can install  the  package.
717       This  eliminates all automatic deduping. If used with global-style this
718       option will be preferred.
719
720   link
721       • Default: false
722
723       • Type: Boolean
724
725
726       If true, then local installs will link if there is a suitable  globally
727       installed package.
728
729       Note  that  this  means  that local installs can cause things to be in‐
730       stalled into the global space at the same time.  The link is only  done
731       if one of the two conditions are met:
732
733       • The package is not already installed globally, or
734
735       • the  globally  installed  version is identical to the version that is
736         being installed locally.
737
738
739   local-address
740       • Default: undefined
741
742       • Type: IP Address
743
744
745       The IP address of the local interface to use when making connections to
746       the npm registry.  Must be IPv4 in versions of Node prior to 0.12.
747
748   loglevel
749       • Default: "notice"
750
751       • Type: String
752
753       • Values:   "silent",  "error",  "warn",  "notice",  "http",  "timing",
754         "info", "verbose", "silly"
755
756
757       What level of logs to report.  On failure,  all  logs  are  written  to
758       npm-debug.log in the current working directory.
759
760       Any  logs  of a higher level than the setting are shown. The default is
761       "notice".
762
763   logstream
764       • Default: process.stderr
765
766       • Type: Stream
767
768
769       This   is   the   stream    that    is    passed    to    the    npmlog
770       https://github.com/npm/npmlog module at run time.
771
772       It  cannot  be set from the command line, but if you are using npm pro‐
773       grammatically, you may wish  to  send  logs  to  somewhere  other  than
774       stderr.
775
776       If  the color config is set to true, then this stream will receive col‐
777       ored output if it is a TTY.
778
779   logs-max
780       • Default: 10
781
782       • Type: Number
783
784
785       The maximum number of log files to store.
786
787   long
788       • Default: false
789
790       • Type: Boolean
791
792
793       Show extended information in npm ls and npm search.
794
795   maxsockets
796       • Default: 50
797
798       • Type: Number
799
800
801       The maximum number of connections to use per origin (protocol/host/port
802       combination). Passed to the http Agent used to make the request.
803
804   message
805       • Default: "%s"
806
807       • Type: String
808
809
810       Commit  message which is used by npm version when creating version com‐
811       mit.
812
813       Any "%s" in the message will be replaced with the version number.
814
815   metrics-registry
816       • Default: The value of   registry  (which  defaults  to  "https://reg
817         istry.npmjs.org/")
818
819       • Type: String
820
821
822       The registry you want to send cli metrics to if send-metrics is true.
823
824   node-options
825       • Default: null
826
827       • Type: String
828
829
830       Options  to  pass  through  to Node.js via the NODE_OPTIONS environment
831       variable.  This does not impact how npm itself is executed but it  does
832       impact how lifecycle scripts are called.
833
834   node-version
835       • Default: process.version
836
837       • Type: semver or false
838
839
840       The node version to use when checking a package's engines map.
841
842   noproxy
843       • Default: null
844
845       • Type: String or Array
846
847
848       A  comma-separated string or an array of domain extensions that a proxy
849       should not be used for.
850
851   offline
852       • Default: false
853
854       • Type: Boolean
855
856
857       Force offline mode: no network requests will be done during install. To
858       allow the CLI to fill in missing cache data, see --prefer-offline.
859
860   onload-script
861       • Default: false
862
863       • Type: path
864
865
866       A node module to require() when npm loads.  Useful for programmatic us‐
867       age.
868
869   only
870       • Default: null
871
872       • Type: String
873
874
875       When "dev" or "development" and running local npm install  without  any
876       arguments, only devDependencies (and their dependencies) are installed.
877
878       When  "dev" or "development" and running local npm ls, npm outdated, or
879       npm update, is an alias for --dev.
880
881       When "prod" or "production" and running local npm install  without  any
882       arguments,  only  non-devDependencies  (and their dependencies) are in‐
883       stalled.
884
885       When "prod" or "production" and running local npm ls, npm outdated,  or
886       npm update, is an alias for --production.
887
888   optional
889       • Default: true
890
891       • Type: Boolean
892
893
894       Attempt  to  install packages in the optionalDependencies object.  Note
895       that if these  packages  fail  to  install,  the  overall  installation
896       process is not aborted.
897
898   otp
899       • Default: null
900
901       • Type: Number
902
903
904       This  is  a  one-time  password  from a two-factor authenticator.  It's
905       needed when publishing or changing package permissions with npm access.
906
907   package-lock
908       • Default: true
909
910       • Type: Boolean
911
912
913       If set to false, then ignore package-lock.json files  when  installing.
914       This will also prevent writing package-lock.json if save is true.
915
916       When  package package-locks are disabled, automatic pruning of extrane‐
917       ous modules will also be disabled.  To remove extraneous  modules  with
918       package-locks disabled use npm prune.
919
920       This option is an alias for --shrinkwrap.
921
922   package-lock-only
923       • Default: false
924
925       • Type: Boolean
926
927
928       If  set  to true, it will update only the package-lock.json, instead of
929       checking node_modules and downloading dependencies.
930
931   parseable
932       • Default: false
933
934       • Type: Boolean
935
936
937       Output parseable results from commands that write to  standard  output.
938       For npm search, this will be tab-separated table format.
939
940   prefer-offline
941       • Default: false
942
943       • Type: Boolean
944
945
946       If true, staleness checks for cached data will be bypassed, but missing
947       data will be requested from the server. To force full offline mode, use
948       --offline.
949
950       This option is effectively equivalent to --cache-min=9999999.
951
952   prefer-online
953       • Default: false
954
955       • Type: Boolean
956
957
958       If  true,  staleness  checks for cached data will be forced, making the
959       CLI look for updates immediately even for fresh package data.
960
961   prefix
962       • Default: see npm help folders
963
964       • Type: path
965
966
967       The location to install global items.  If set on the command line, then
968       it forces non-global commands to run in the specified folder.
969
970   preid
971       • Default: ""
972
973       • Type: String
974
975
976       The  "prerelease  identifier"  to  use as a prefix for the "prerelease"
977       part of a semver. Like the rc in 1.2.0-rc.8.
978
979   production
980       • Default: false
981
982       • Type: Boolean
983
984
985       Set to true to run in "production" mode.
986
987       1. devDependencies are not installed at the topmost level when  running
988          local npm install without any arguments.
989
990       2. Set the NODE_ENV="production" for lifecycle scripts.
991
992
993   progress
994       • Default: true, unless TRAVIS or CI env vars set.
995
996       • Type: Boolean
997
998
999       When set to true, npm will display a progress bar during time intensive
1000       operations, if process.stderr is a TTY.
1001
1002       Set to false to suppress the progress bar.
1003
1004   proxy
1005       • Default: null
1006
1007       • Type: url
1008
1009
1010       A proxy to use  for  outgoing  http  requests.  If  the  HTTP_PROXY  or
1011       http_proxy  environment  variables are set, proxy settings will be hon‐
1012       ored by the underlying request library.
1013
1014   read-only
1015       • Default: false
1016
1017       • Type: Boolean
1018
1019
1020       This is used to mark a token as unable to publish when configuring lim‐
1021       ited access tokens with the npm token create command.
1022
1023   rebuild-bundle
1024       • Default: true
1025
1026       • Type: Boolean
1027
1028
1029       Rebuild bundled dependencies after installation.
1030
1031   registry
1032       • Default: https://registry.npmjs.org/
1033
1034       • Type: url
1035
1036
1037       The base URL of the npm package registry.
1038
1039   rollback
1040       • Default: true
1041
1042       • Type: Boolean
1043
1044
1045       Remove failed installs.
1046
1047   save
1048       • Default: true
1049
1050       • Type: Boolean
1051
1052
1053       Save installed packages to a package.json file as dependencies.
1054
1055       When  used with the npm rm command, it removes it from the dependencies
1056       object.
1057
1058       Only works if there is already a package.json file present.
1059
1060   save-bundle
1061       • Default: false
1062
1063       • Type: Boolean
1064
1065
1066       If a package would be saved at install  time  by  the  use  of  --save,
1067       --save-dev, or --save-optional, then also put it in the bundleDependen‐
1068       cies list.
1069
1070       When used with the npm rm command, it removes it from the bundledDepen‐
1071       dencies list.
1072
1073   save-prod
1074       • Default: false
1075
1076       • Type: Boolean
1077
1078
1079       Makes sure that a package will be saved into dependencies specifically.
1080       This is useful if a package already exists in  devDependencies  or  op‐
1081       tionalDependencies,  but  you  want  to move it to be a production dep.
1082       This is also the default  behavior  if  --save  is  true,  and  neither
1083       --save-dev or --save-optional are true.
1084
1085   save-dev
1086       • Default: false
1087
1088       • Type: Boolean
1089
1090
1091       Save installed packages to a package.json file as devDependencies.
1092
1093       When  used with the npm rm command, it removes it from the devDependen‐
1094       cies object.
1095
1096       Only works if there is already a package.json file present.
1097
1098   save-exact
1099       • Default: false
1100
1101       • Type: Boolean
1102
1103
1104       Dependencies  saved  to  package.json  using  --save,   --save-dev   or
1105       --save-optional  will  be  configured with an exact version rather than
1106       using npm's default semver range operator.
1107
1108   save-optional
1109       • Default: false
1110
1111       • Type: Boolean
1112
1113
1114       Save installed packages to a package.json file as optionalDependencies.
1115
1116       When used with the npm rm command, it removes it from the  devDependen‐
1117       cies object.
1118
1119       Only works if there is already a package.json file present.
1120
1121   save-prefix
1122       • Default: '^'
1123
1124       • Type: String
1125
1126
1127       Configure how versions of packages installed to a package.json file via
1128       --save or --save-dev get prefixed.
1129
1130       For example if a package has version 1.2.3, by default its  version  is
1131       set  to  ^1.2.3 which allows minor upgrades for that package, but after
1132       npm config set save-prefix='~' it would be set to ~1.2.3 which only al‐
1133       lows patch upgrades.
1134
1135   scope
1136       • Default: the scope of the current project, if any, or ""
1137
1138       • Type: String
1139
1140
1141       Associate  an operation with a scope for a scoped registry. Useful when
1142       logging in to  a  private  registry  for  the  first  time:  npm  login
1143       --scope=@organization  --registry=registry.organization.com, which will
1144       cause @organization to be mapped to the registry for  future  installa‐
1145       tion of packages specified according to the pattern @organization/pack‐
1146       age.
1147
1148   script-shell
1149       • Default: null
1150
1151       • Type: path
1152
1153
1154       The shell to use for scripts run with the npm run command.
1155
1156   scripts-prepend-node-path
1157       • Default: "warn-only"
1158
1159       • Type: Boolean, "auto" or "warn-only"
1160
1161
1162       If set to true, add the directory in which the current node  executable
1163       resides  to the PATH environment variable when running scripts, even if
1164       that means that npm will invoke a different node  executable  than  the
1165       one which it is running.
1166
1167       If set to false, never modify PATH with that.
1168
1169       If  set  to  "warn-only",  never modify PATH but print a warning if npm
1170       thinks that you may want to run it with true, e.g. because the node ex‐
1171       ecutable in the PATH is not the one npm was invoked with.
1172
1173       If  set  to auto, only add that directory to the PATH environment vari‐
1174       able if the node executable with which npm was invoked and the one that
1175       is found first on the PATH are different.
1176
1177   searchexclude
1178       • Default: ""
1179
1180       • Type: String
1181
1182
1183       Space-separated options that limit the results from search.
1184
1185   searchopts
1186       • Default: ""
1187
1188       • Type: String
1189
1190
1191       Space-separated options that are always passed to search.
1192
1193   searchlimit
1194       • Default: 20
1195
1196       • Type: Number
1197
1198
1199       Number  of  items  to limit search results to. Will not apply at all to
1200       legacy searches.
1201
1202   searchstaleness
1203       • Default: 900 (15 minutes)
1204
1205       • Type: Number
1206
1207
1208       The age of the cache, in seconds, before another  registry  request  is
1209       made if using legacy search endpoint.
1210
1211   send-metrics
1212       • Default: false
1213
1214       • Type: Boolean
1215
1216
1217       If  true,  success/failure  metrics  will  be  reported to the registry
1218       stored in metrics-registry.  These requests contain the number of  suc‐
1219       cessful  and  failing runs of the npm CLI and the time period overwhich
1220       those counts were gathered. No identifying information is  included  in
1221       these requests.
1222
1223   shell
1224       • Default:  SHELL environment variable, or "bash" on Posix, or "cmd" on
1225         Windows
1226
1227       • Type: path
1228
1229
1230       The shell to run for the npm explore command.
1231
1232   shrinkwrap
1233       • Default: true
1234
1235       • Type: Boolean
1236
1237
1238       If set to false, then ignore npm-shrinkwrap.json files when installing.
1239       This will also prevent writing npm-shrinkwrap.json if save is true.
1240
1241       This option is an alias for --package-lock.
1242
1243   sign-git-commit
1244       • Default: false
1245
1246       • Type: Boolean
1247
1248
1249       If  set to true, then the npm version command will commit the new pack‐
1250       age version using -S to add a signature.
1251
1252       Note that git requires you to have set up GPG keys in your git  configs
1253       for this to work properly.
1254
1255   sign-git-tag
1256       • Default: false
1257
1258       • Type: Boolean
1259
1260
1261       If set to true, then the npm version command will tag the version using
1262       -s to add a signature.
1263
1264       Note that git requires you to have set up GPG keys in your git  configs
1265       for this to work properly.
1266
1267   sso-poll-frequency
1268       • Default: 500
1269
1270       • Type: Number
1271
1272
1273       When  used  with  SSO-enabled  auth-types, configures how regularly the
1274       registry should be polled while the user is completing authentication.
1275
1276   sso-type
1277       • Default: 'oauth'
1278
1279       • Type: 'oauth', 'saml', or null
1280
1281
1282       If --auth-type=sso, the type of SSO type to use.
1283
1284   strict-ssl
1285       • Default: true
1286
1287       • Type: Boolean
1288
1289
1290       Whether or not to do SSL key validation when  making  requests  to  the
1291       registry via https.
1292
1293       See also the ca config.
1294
1295   tag
1296       • Default: latest
1297
1298       • Type: String
1299
1300
1301       If  you  ask npm to install a package and don't tell it a specific ver‐
1302       sion, then it will install the specified tag.
1303
1304       Also the tag that is added to the package@version specified by the  npm
1305       tag command, if no explicit tag is given.
1306
1307   tag-version-prefix
1308       • Default: "v"
1309
1310       • Type: String
1311
1312
1313       If set, alters the prefix used when tagging a new version when perform‐
1314       ing a version increment using  npm-version. To remove the prefix  alto‐
1315       gether, set it to the empty string: "".
1316
1317       Because  other  tools  may rely on the convention that npm version tags
1318       look like v1.0.0, only use this property if it is absolutely necessary.
1319       In  particular,  use care when overriding this setting for public pack‐
1320       ages.
1321
1322   timing
1323       • Default: false
1324
1325       • Type: Boolean
1326
1327
1328       If true, writes an npm-debug log to _logs  and  timing  information  to
1329       _timing.json,  both in your cache.  _timing.json is a newline delimited
1330       list of  JSON  objects.   You  can  quickly  view  it  with  this  json
1331       https://www.npmjs.com/package/json command line: json -g < ~/.npm/_tim‐
1332       ing.json.
1333
1334   tmp
1335       • Default: TMPDIR environment variable, or "/tmp"
1336
1337       • Type: path
1338
1339
1340       Where to store temporary files and folders.  All temp files are deleted
1341       on success, but left behind on failure for forensic purposes.
1342
1343   unicode
1344       • Default:  false  on  windows, true on mac/unix systems with a unicode
1345         locale
1346
1347       • Type: Boolean
1348
1349
1350       When set to true, npm uses unicode characters in the tree output.  When
1351       false, it uses ascii characters to draw trees.
1352
1353   unsafe-perm
1354       • Default: false if running as root, true otherwise
1355
1356       • Type: Boolean
1357
1358
1359       Set  to  true  to  suppress  the UID/GID switching when running package
1360       scripts.  If set explicitly to false, then  installing  as  a  non-root
1361       user will fail.
1362
1363   update-notifier
1364       • Default: true
1365
1366       • Type: Boolean
1367
1368
1369       Set  to  false  to suppress the update notification when using an older
1370       version of npm than the latest.
1371
1372   usage
1373       • Default: false
1374
1375       • Type: Boolean
1376
1377
1378       Set to show short usage output (like the -H output) instead of complete
1379       help when doing npm help help.
1380
1381   user
1382       • Default: "nobody"
1383
1384       • Type: String or Number
1385
1386
1387       The UID to set to when running package scripts as root.
1388
1389   userconfig
1390       • Default: ~/.npmrc
1391
1392       • Type: path
1393
1394
1395       The location of user-level configuration settings.
1396
1397   umask
1398       • Default: 022
1399
1400       • Type: Octal numeric string in range 0000..0777 (0..511)
1401
1402
1403       The  "umask"  value to use when setting the file creation mode on files
1404       and folders.
1405
1406       Folders and executables are given a mode which is 0777  masked  against
1407       this  value.  Other files are given a mode which is 0666 masked against
1408       this value.  Thus, the defaults are 0755 and 0644 respectively.
1409
1410   user-agent
1411       • Default: node/{process.version} {process.platform} {process.arch}
1412
1413       • Type: String
1414
1415
1416       Sets a User-Agent to the request header
1417
1418   version
1419       • Default: false
1420
1421       • Type: boolean
1422
1423
1424       If true, output the npm version and exit successfully.
1425
1426       Only relevant when specified explicitly on the command line.
1427
1428   versions
1429       • Default: false
1430
1431       • Type: boolean
1432
1433
1434       If true, output the npm version as well as node's process.versions map,
1435       and exit successfully.
1436
1437       Only relevant when specified explicitly on the command line.
1438
1439   viewer
1440       • Default: "man" on Posix, "browser" on Windows
1441
1442       • Type: path
1443
1444
1445       The program to use to view help content.
1446
1447       Set to "browser" to view html help content in the default web browser.
1448
1449   See also
1450       • npm help config
1451
1452       • npm help npmrc
1453
1454       • npm help scripts
1455
1456       • npm help folders
1457
1458       • npm help npm
1459
1460
1461
1462
1463                                  April 2021                         CONFIG(7)
Impressum