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

NAME

6       npm-config  -  More than you probably want to know about npm configura‐
7       tion
8

DESCRIPTION

10       npm gets its configuration values from the following sources, sorted by
11       priority:
12
13   Command Line Flags
14       Putting --foo bar on the command line sets the foo configuration param‐
15       eter to "bar".  A -- argument tells the  cli  parser  to  stop  reading
16       flags.  Using --flag without specifying any value will set the value to
17       true.
18
19       Example: --flag1 --flag2 will  set  both  configuration  parameters  to
20       true,  while  --flag1  --flag2 bar will set flag1 to true, and flag2 to
21       bar.  Finally, --flag1 --flag2  --  bar  will  set  both  configuration
22       parameters to true, and the bar is taken as a command argument.
23
24   Environment Variables
25       Any  environment  variables  that start with npm_config_ will be inter‐
26       preted as a configuration parameter.   For  example,  putting  npm_con‐
27       fig_foo=bar  in your environment will set the foo configuration parame‐
28       ter to bar.  Any environment configurations that are not given a  value
29       will  be  given the value of true.  Config values are case-insensitive,
30       so NPM_CONFIG_FOO=bar will work the same.  However,  please  note  that
31       inside npm-scripts /misc/scripts npm will set its own environment vari‐
32       ables and Node will prefer those lowercase versions over any  uppercase
33       ones    that   you   might   set.    For   details   see   this   issue
34       https://github.com/npm/npm/issues/14528.
35
36       Notice  that  you  need  to  use  underscores  instead  of  dashes,  so
37       --allow-same-version would become npm_config_allow_same_version=true.
38
39   npmrc Files
40       The four relevant files are:
41
42       · per-project configuration file (/path/to/my/project/.npmrc)
43
44       · per-user  configuration  file (defaults to $HOME/.npmrc; configurable
45         via CLI option --userconfig or environment variable $NPM_CONFIG_USER‐
46         CONFIG)
47
48       · global  configuration  file  (defaults  to $PREFIX/etc/npmrc; config‐
49         urable  via  CLI  option  --globalconfig  or   environment   variable
50         $NPM_CONFIG_GLOBALCONFIG)
51
52       · npm's built-in configuration file (/path/to/npm/npmrc)
53
54
55       See npm help 5 npmrc for more details.
56
57   Default Configs
58       Run  npm config ls -l to see a set of configuration parameters that are
59       internal to npm, and are defaults if nothing else is specified.
60

Shorthands and Other CLI Niceties

62       The following shorthands are parsed on the command-line:
63
64       · -v: --version
65
66       · -h, -?, --help, -H: --usage
67
68       · -s, --silent: --loglevel silent
69
70       · -q, --quiet: --loglevel warn
71
72       · -d: --loglevel info
73
74       · -dd, --verbose: --loglevel verbose
75
76       · -ddd: --loglevel silly
77
78       · -g: --global
79
80       · -C: --prefix
81
82       · -l: --long
83
84       · -m: --message
85
86       · -p, --porcelain: --parseable
87
88       · -reg: --registry
89
90       · -f: --force
91
92       · -desc: --description
93
94       · -S: --save
95
96       · -P: --save-prod
97
98       · -D: --save-dev
99
100       · -O: --save-optional
101
102       · -B: --save-bundle
103
104       · -E: --save-exact
105
106       · -y: --yes
107
108       · -n: --yes false
109
110       · ll and la commands: ls --long
111
112
113       If the specified configuration param resolves unambiguously to a  known
114       configuration  parameter,  then  it  is  expanded to that configuration
115       parameter.  For example:
116
117         npm ls --par
118         # same as:
119         npm ls --parseable
120
121       If multiple single-character shorthands are strung  together,  and  the
122       resulting  combination  is  unambiguously  not some other configuration
123       param, then it is expanded to its various component pieces.  For  exam‐
124       ple:
125
126         npm ls -gpld
127         # same as:
128         npm ls --global --parseable --long --loglevel info
129

Per-Package Config Settings

131       When  running  scripts  (see  npm  help 7 npm-scripts) the package.json
132       "config" keys are overwritten in the environment if there is  a  config
133       param  of  <name>[@<version>]:<key>.   For example, if the package.json
134       has this:
135
136         { "name" : "foo"
137         , "config" : { "port" : "8080" }
138         , "scripts" : { "start" : "node server.js" } }
139
140       and the server.js is this:
141
142         http.createServer(...).listen(process.env.npm_package_config_port)
143
144       then the user could change the behavior by doing:
145
146         npm config set foo:port 80
147
148       See npm help 5 package.json for more information.
149

Config Settings

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

SEE ALSO

1432       · npm help config
1433
1434       · npm help 5 npmrc
1435
1436       · npm help 7 scripts
1437
1438       · npm help 5 folders
1439
1440       · npm help npm
1441
1442
1443
1444
1445
1446                                  April 2019                     NPM-CONFIG(7)
Impressum