1CONFIG(7) CONFIG(7)
2
3
4
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: <!-- AUTOGEN‐
62 ERATED CONFIG SHORTHANDS START --> <!-- automatically generated, do not
63 edit manually --> <!-- see lib/utils/config/definitions.js -->
64
65 • -a: --all
66
67 • --enjoy-by: --before
68
69 • -c: --call
70
71 • --desc: --description
72
73 • -f: --force
74
75 • -g: --global
76
77 • -L: --location
78
79 • -d: --loglevel info
80
81 • -s: --loglevel silent
82
83 • --silent: --loglevel silent
84
85 • --ddd: --loglevel silly
86
87 • --dd: --loglevel verbose
88
89 • --verbose: --loglevel verbose
90
91 • -q: --loglevel warn
92
93 • --quiet: --loglevel warn
94
95 • -l: --long
96
97 • -m: --message
98
99 • --local: --no-global
100
101 • -n: --no-yes
102
103 • --no: --no-yes
104
105 • -p: --parseable
106
107 • --porcelain: --parseable
108
109 • -C: --prefix
110
111 • --readonly: --read-only
112
113 • --reg: --registry
114
115 • -S: --save
116
117 • -B: --save-bundle
118
119 • -D: --save-dev
120
121 • -E: --save-exact
122
123 • -O: --save-optional
124
125 • -P: --save-prod
126
127 • -?: --usage
128
129 • -h: --usage
130
131 • -H: --usage
132
133 • --help: --usage
134
135 • -v: --version
136
137 • -w: --workspace
138
139 • --ws: --workspaces
140
141 • -y: --yes
142
143 <!-- automatically generated, do not edit manually --> <!-- see
144 lib/utils/config/definitions.js --> <!-- AUTOGENERATED CONFIG SHORT‐
145 HANDS END -->
146
147
148 If the specified configuration param resolves unambiguously to a known
149 configuration parameter, then it is expanded to that configuration pa‐
150 rameter. For example:
151
152 npm ls --par
153 # same as:
154 npm ls --parseable
155
156 If multiple single-character shorthands are strung together, and the
157 resulting combination is unambiguously not some other configuration
158 param, then it is expanded to its various component pieces. For exam‐
159 ple:
160
161 npm ls -gpld
162 # same as:
163 npm ls --global --parseable --long --loglevel info
164
165 Config Settings
166 <!-- AUTOGENERATED CONFIG DESCRIPTIONS START --> <!-- automatically
167 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
168 tions.js -->
169
170 _auth
171 • Default: null
172
173 • Type: null or String
174
175
176 A basic-auth string to use when authenticating against the npm reg‐
177 istry.
178
179 Warning: This should generally not be set via a command-line option. It
180 is safer to use a registry-provided authentication bearer token stored
181 in the ~/.npmrc file by running npm login. <!-- automatically gener‐
182 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
183 -->
184
185
186 access
187 • Default: 'restricted' for scoped packages, 'public' for unscoped
188 packages
189
190 • Type: null, "restricted", or "public"
191
192
193 When publishing scoped packages, the access level defaults to re‐
194 stricted. If you want your scoped package to be publicly viewable (and
195 installable) set --access=public. The only valid values for access are
196 public and restricted. Unscoped packages always have an access level of
197 public.
198
199 Note: Using the --access flag on the npm publish command will only set
200 the package access level on the initial publish of the package. Any
201 subsequent npm publish commands using the --access flag will not have
202 an effect to the access level. To make changes to the access level af‐
203 ter the initial publish use npm access. <!-- automatically generated,
204 do not edit manually --> <!-- see lib/utils/config/definitions.js -->
205
206
207 all
208 • Default: false
209
210 • Type: Boolean
211
212
213 When running npm outdated and npm ls, setting --all will show all out‐
214 dated or installed packages, rather than only those directly depended
215 upon by the current project. <!-- automatically generated, do not edit
216 manually --> <!-- see lib/utils/config/definitions.js -->
217
218
219 allow-same-version
220 • Default: false
221
222 • Type: Boolean
223
224
225 Prevents throwing an error when npm version is used to set the new ver‐
226 sion to the same value as the current version. <!-- automatically gen‐
227 erated, do not edit manually --> <!-- see lib/utils/config/defini‐
228 tions.js -->
229
230
231 audit
232 • Default: true
233
234 • Type: Boolean
235
236
237 When "true" submit audit reports alongside the current npm command to
238 the default registry and all registries configured for scopes. See the
239 documentation for npm help audit for details on what is submitted.
240 <!-- automatically generated, do not edit manually --> <!-- see
241 lib/utils/config/definitions.js -->
242
243
244 audit-level
245 • Default: null
246
247 • Type: null, "info", "low", "moderate", "high", "critical", or "none"
248
249
250 The minimum level of vulnerability for npm audit to exit with a
251 non-zero exit code. <!-- automatically generated, do not edit manually
252 --> <!-- see lib/utils/config/definitions.js -->
253
254
255 before
256 • Default: null
257
258 • Type: null or Date
259
260
261 If passed to npm install, will rebuild the npm tree such that only ver‐
262 sions that were available on or before the --before time get installed.
263 If there's no versions available for the current set of direct depen‐
264 dencies, the command will error.
265
266 If the requested version is a dist-tag and the given tag does not pass
267 the --before filter, the most recent version less than or equal to that
268 tag will be used. For example, foo@latest might install foo@1.2 even
269 though latest is 2.0. <!-- automatically generated, do not edit manu‐
270 ally --> <!-- see lib/utils/config/definitions.js -->
271
272
273 bin-links
274 • Default: true
275
276 • Type: Boolean
277
278
279 Tells npm to create symlinks (or .cmd shims on Windows) for package ex‐
280 ecutables.
281
282 Set to false to have it not do this. This can be used to work around
283 the fact that some file systems don't support symlinks, even on osten‐
284 sibly Unix systems. <!-- automatically generated, do not edit manually
285 --> <!-- see lib/utils/config/definitions.js -->
286
287
288 browser
289 • Default: OS X: "open", Windows: "start", Others: "xdg-open"
290
291 • Type: null, Boolean, or String
292
293
294 The browser that is called by npm commands to open websites.
295
296 Set to false to suppress browser behavior and instead print urls to
297 terminal.
298
299 Set to true to use default system URL opener. <!-- automatically gen‐
300 erated, do not edit manually --> <!-- see lib/utils/config/defini‐
301 tions.js -->
302
303
304 ca
305 • Default: null
306
307 • Type: null or String (can be set multiple times)
308
309
310 The Certificate Authority signing certificate that is trusted for SSL
311 connections to the registry. Values should be in PEM format (Windows
312 calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the
313 string "\n". For example:
314
315 ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
316
317 Set to null to only allow "known" registrars, or to a specific CA cert
318 to trust only that specific signing authority.
319
320 Multiple CAs can be trusted by specifying an array of certificates:
321
322 ca[]="..."
323 ca[]="..."
324
325 See also the strict-ssl config. <!-- automatically generated, do not
326 edit manually --> <!-- see lib/utils/config/definitions.js -->
327
328
329 cache
330 • Default: Windows: %LocalAppData%\npm-cache, Posix: ~/.npm
331
332 • Type: Path
333
334
335 The location of npm's cache directory. See npm help npm cache <!-- au‐
336 tomatically generated, do not edit manually --> <!-- see lib/utils/con‐
337 fig/definitions.js -->
338
339
340 cafile
341 • Default: null
342
343 • Type: Path
344
345
346 A path to a file containing one or multiple Certificate Authority sign‐
347 ing certificates. Similar to the ca setting, but allows for multiple
348 CA's, as well as for the CA information to be stored in a file on disk.
349 <!-- automatically generated, do not edit manually --> <!-- see
350 lib/utils/config/definitions.js -->
351
352
353 call
354 • Default: ""
355
356 • Type: String
357
358
359 Optional companion option for npm exec, npx that allows for specifying
360 a custom command to be run along with the installed packages.
361
362 npm exec --package yo --package generator-node --call "yo node"
363 <!-- automatically generated, do not edit manually --> <!-- see
364 lib/utils/config/definitions.js -->
365
366
367 cert
368 • Default: null
369
370 • Type: null or String
371
372
373 A client certificate to pass when accessing the registry. Values should
374 be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with
375 newlines replaced by the string "\n". For example:
376
377 cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
378
379 It is not the path to a certificate file (and there is no "certfile"
380 option). <!-- automatically generated, do not edit manually --> <!--
381 see lib/utils/config/definitions.js -->
382
383
384 ci-name
385 • Default: The name of the current CI system, or null when not on a
386 known CI platform.
387
388 • Type: null or String
389
390
391 The name of a continuous integration system. If not set explicitly, npm
392 will detect the current CI environment using the @npmcli/ci-detect
393 http://npm.im/@npmcli/ci-detect module. <!-- automatically generated,
394 do not edit manually --> <!-- see lib/utils/config/definitions.js -->
395
396
397 cidr
398 • Default: null
399
400 • Type: null or String (can be set multiple times)
401
402
403 This is a list of CIDR address to be used when configuring limited ac‐
404 cess tokens with the npm token create command. <!-- automatically gen‐
405 erated, do not edit manually --> <!-- see lib/utils/config/defini‐
406 tions.js -->
407
408
409 color
410 • Default: true unless the NO_COLOR environ is set to something other
411 than '0'
412
413 • Type: "always" or Boolean
414
415
416 If false, never shows colors. If "always" then always shows colors. If
417 true, then only prints color codes for tty file descriptors. <!-- au‐
418 tomatically generated, do not edit manually --> <!-- see lib/utils/con‐
419 fig/definitions.js -->
420
421
422 commit-hooks
423 • Default: true
424
425 • Type: Boolean
426
427
428 Run git commit hooks when using the npm version command. <!-- automat‐
429 ically generated, do not edit manually --> <!-- see lib/utils/con‐
430 fig/definitions.js -->
431
432
433 depth
434 • Default: Infinity if --all is set, otherwise 1
435
436 • Type: null or Number
437
438
439 The depth to go when recursing packages for npm ls.
440
441 If not set, npm ls will show only the immediate dependencies of the
442 root project. If --all is set, then npm will show all dependencies by
443 default. <!-- automatically generated, do not edit manually --> <!--
444 see lib/utils/config/definitions.js -->
445
446
447 description
448 • Default: true
449
450 • Type: Boolean
451
452
453 Show the description in npm search <!-- automatically generated, do not
454 edit manually --> <!-- see lib/utils/config/definitions.js -->
455
456
457 diff
458 • Default:
459
460 • Type: String (can be set multiple times)
461
462
463 Define arguments to compare in npm diff. <!-- automatically generated,
464 do not edit manually --> <!-- see lib/utils/config/definitions.js -->
465
466
467 diff-dst-prefix
468 • Default: "b/"
469
470 • Type: String
471
472
473 Destination prefix to be used in npm diff output. <!-- automatically
474 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
475 tions.js -->
476
477
478 diff-ignore-all-space
479 • Default: false
480
481 • Type: Boolean
482
483
484 Ignore whitespace when comparing lines in npm diff. <!-- automatically
485 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
486 tions.js -->
487
488
489 diff-name-only
490 • Default: false
491
492 • Type: Boolean
493
494
495 Prints only filenames when using npm diff. <!-- automatically gener‐
496 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
497 -->
498
499
500 diff-no-prefix
501 • Default: false
502
503 • Type: Boolean
504
505
506 Do not show any source or destination prefix in npm diff output.
507
508 Note: this causes npm diff to ignore the --diff-src-prefix and
509 --diff-dst-prefix configs. <!-- automatically generated, do not edit
510 manually --> <!-- see lib/utils/config/definitions.js -->
511
512
513 diff-src-prefix
514 • Default: "a/"
515
516 • Type: String
517
518
519 Source prefix to be used in npm diff output. <!-- automatically gener‐
520 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
521 -->
522
523
524 diff-text
525 • Default: false
526
527 • Type: Boolean
528
529
530 Treat all files as text in npm diff. <!-- automatically generated, do
531 not edit manually --> <!-- see lib/utils/config/definitions.js -->
532
533
534 diff-unified
535 • Default: 3
536
537 • Type: Number
538
539
540 The number of lines of context to print in npm diff. <!-- automati‐
541 cally generated, do not edit manually --> <!-- see lib/utils/con‐
542 fig/definitions.js -->
543
544
545 dry-run
546 • Default: false
547
548 • Type: Boolean
549
550
551 Indicates that you don't want npm to make any changes and that it
552 should only report what it would have done. This can be passed into any
553 of the commands that modify your local installation, eg, install, up‐
554 date, dedupe, uninstall, as well as pack and publish.
555
556 Note: This is NOT honored by other network related commands, eg
557 dist-tags, owner, etc. <!-- automatically generated, do not edit manu‐
558 ally --> <!-- see lib/utils/config/definitions.js -->
559
560
561 editor
562 • Default: The EDITOR or VISUAL environment variables, or 'notepad.exe'
563 on Windows, or 'vim' on Unix systems
564
565 • Type: String
566
567
568 The command to run for npm edit and npm config edit. <!-- automati‐
569 cally generated, do not edit manually --> <!-- see lib/utils/con‐
570 fig/definitions.js -->
571
572
573 engine-strict
574 • Default: false
575
576 • Type: Boolean
577
578
579 If set to true, then npm will stubbornly refuse to install (or even
580 consider installing) any package that claims to not be compatible with
581 the current Node.js version.
582
583 This can be overridden by setting the --force flag. <!-- automatically
584 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
585 tions.js -->
586
587
588 fetch-retries
589 • Default: 2
590
591 • Type: Number
592
593
594 The "retries" config for the retry module to use when fetching packages
595 from the registry.
596
597 npm will retry idempotent read requests to the registry in the case of
598 network failures or 5xx HTTP errors. <!-- automatically generated, do
599 not edit manually --> <!-- see lib/utils/config/definitions.js -->
600
601
602 fetch-retry-factor
603 • Default: 10
604
605 • Type: Number
606
607
608 The "factor" config for the retry module to use when fetching packages.
609 <!-- automatically generated, do not edit manually --> <!-- see
610 lib/utils/config/definitions.js -->
611
612
613 fetch-retry-maxtimeout
614 • Default: 60000 (1 minute)
615
616 • Type: Number
617
618
619 The "maxTimeout" config for the retry module to use when fetching pack‐
620 ages. <!-- automatically generated, do not edit manually --> <!-- see
621 lib/utils/config/definitions.js -->
622
623
624 fetch-retry-mintimeout
625 • Default: 10000 (10 seconds)
626
627 • Type: Number
628
629
630 The "minTimeout" config for the retry module to use when fetching pack‐
631 ages. <!-- automatically generated, do not edit manually --> <!-- see
632 lib/utils/config/definitions.js -->
633
634
635 fetch-timeout
636 • Default: 300000 (5 minutes)
637
638 • Type: Number
639
640
641 The maximum amount of time to wait for HTTP requests to complete. <!--
642 automatically generated, do not edit manually --> <!-- see
643 lib/utils/config/definitions.js -->
644
645
646 force
647 • Default: false
648
649 • Type: Boolean
650
651
652 Removes various protections against unfortunate side effects, common
653 mistakes, unnecessary performance degradation, and malicious input.
654
655 • Allow clobbering non-npm files in global installs.
656
657 • Allow the npm version command to work on an unclean git repository.
658
659 • Allow deleting the cache folder with npm cache clean.
660
661 • Allow installing packages that have an engines declaration requiring
662 a different version of npm.
663
664 • Allow installing packages that have an engines declaration requiring
665 a different version of node, even if --engine-strict is enabled.
666
667 • Allow npm audit fix to install modules outside your stated dependency
668 range (including SemVer-major changes).
669
670 • Allow unpublishing all versions of a published package.
671
672 • Allow conflicting peerDependencies to be installed in the root
673 project.
674
675 • Implicitly set --yes during npm init.
676
677 • Allow clobbering existing values in npm pkg
678
679
680 If you don't have a clear idea of what you want to do, it is strongly
681 recommended that you do not use this option! <!-- automatically gener‐
682 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
683 -->
684
685
686 foreground-scripts
687 • Default: false
688
689 • Type: Boolean
690
691
692 Run all build scripts (ie, preinstall, install, and postinstall)
693 scripts for installed packages in the foreground process, sharing stan‐
694 dard input, output, and error with the main npm process.
695
696 Note that this will generally make installs run slower, and be much
697 noisier, but can be useful for debugging. <!-- automatically gener‐
698 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
699 -->
700
701
702 format-package-lock
703 • Default: true
704
705 • Type: Boolean
706
707
708 Format package-lock.json or npm-shrinkwrap.json as a human readable
709 file. <!-- automatically generated, do not edit manually --> <!-- see
710 lib/utils/config/definitions.js -->
711
712
713 fund
714 • Default: true
715
716 • Type: Boolean
717
718
719 When "true" displays the message at the end of each npm install ac‐
720 knowledging the number of dependencies looking for funding. See npm
721 help npm fund for details. <!-- automatically generated, do not edit
722 manually --> <!-- see lib/utils/config/definitions.js -->
723
724
725 git
726 • Default: "git"
727
728 • Type: String
729
730
731 The command to use for git commands. If git is installed on the com‐
732 puter, but is not in the PATH, then set this to the full path to the
733 git binary. <!-- automatically generated, do not edit manually -->
734 <!-- see lib/utils/config/definitions.js -->
735
736
737 git-tag-version
738 • Default: true
739
740 • Type: Boolean
741
742
743 Tag the commit when using the npm version command. <!-- automatically
744 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
745 tions.js -->
746
747
748 global
749 • Default: false
750
751 • Type: Boolean
752
753
754 Operates in "global" mode, so that packages are installed into the pre‐
755 fix folder instead of the current working directory. See npm help fold‐
756 ers for more on the differences in behavior.
757
758 • packages are installed into the {prefix}/lib/node_modules folder, in‐
759 stead of the current working directory.
760
761 • bin files are linked to {prefix}/bin
762
763 • man pages are linked to {prefix}/share/man
764
765 <!-- automatically generated, do not edit manually --> <!-- see
766 lib/utils/config/definitions.js -->
767
768
769 global-style
770 • Default: false
771
772 • Type: Boolean
773
774
775 Causes npm to install the package into your local node_modules folder
776 with the same layout it uses with the global node_modules folder. Only
777 your direct dependencies will show in node_modules and everything they
778 depend on will be flattened in their node_modules folders. This obvi‐
779 ously will eliminate some deduping. If used with legacy-bundling,
780 legacy-bundling will be preferred. <!-- automatically generated, do
781 not edit manually --> <!-- see lib/utils/config/definitions.js -->
782
783
784 globalconfig
785 • Default: The global --prefix setting plus 'etc/npmrc'. For example,
786 '/usr/local/etc/npmrc'
787
788 • Type: Path
789
790
791 The config file to read for global config options. <!-- automatically
792 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
793 tions.js -->
794
795
796 heading
797 • Default: "npm"
798
799 • Type: String
800
801
802 The string that starts all the debugging log output. <!-- automati‐
803 cally generated, do not edit manually --> <!-- see lib/utils/con‐
804 fig/definitions.js -->
805
806
807 https-proxy
808 • Default: null
809
810 • Type: null or URL
811
812
813 A proxy to use for outgoing https requests. If the HTTPS_PROXY or
814 https_proxy or HTTP_PROXY or http_proxy environment variables are set,
815 proxy settings will be honored by the underlying make-fetch-happen li‐
816 brary. <!-- automatically generated, do not edit manually --> <!-- see
817 lib/utils/config/definitions.js -->
818
819
820 if-present
821 • Default: false
822
823 • Type: Boolean
824
825
826 If true, npm will not exit with an error code when run-script is in‐
827 voked for a script that isn't defined in the scripts section of pack‐
828 age.json. This option can be used when it's desirable to optionally
829 run a script when it's present and fail if the script fails. This is
830 useful, for example, when running scripts that may only apply for some
831 builds in an otherwise generic CI setup. <!-- automatically generated,
832 do not edit manually --> <!-- see lib/utils/config/definitions.js -->
833
834
835 ignore-scripts
836 • Default: false
837
838 • Type: Boolean
839
840
841 If true, npm does not run scripts specified in package.json files.
842
843 Note that commands explicitly intended to run a particular script, such
844 as npm start, npm stop, npm restart, npm test, and npm run-script will
845 still run their intended script if ignore-scripts is set, but they will
846 not run any pre- or post-scripts. <!-- automatically generated, do not
847 edit manually --> <!-- see lib/utils/config/definitions.js -->
848
849
850 include
851 • Default:
852
853 • Type: "prod", "dev", "optional", or "peer" (can be set multiple
854 times)
855
856
857 Option that allows for defining which types of dependencies to install.
858
859 This is the inverse of --omit=<type>.
860
861 Dependency types specified in --include will not be omitted, regardless
862 of the order in which omit/include are specified on the command-line.
863 <!-- automatically generated, do not edit manually --> <!-- see
864 lib/utils/config/definitions.js -->
865
866
867 include-staged
868 • Default: false
869
870 • Type: Boolean
871
872
873 Allow installing "staged" published packages, as defined by npm RFC PR
874 #92 https://github.com/npm/rfcs/pull/92.
875
876 This is experimental, and not implemented by the npm public registry.
877 <!-- automatically generated, do not edit manually --> <!-- see
878 lib/utils/config/definitions.js -->
879
880
881 init-author-email
882 • Default: ""
883
884 • Type: String
885
886
887 The value npm init should use by default for the package author's
888 email. <!-- automatically generated, do not edit manually --> <!-- see
889 lib/utils/config/definitions.js -->
890
891
892 init-author-name
893 • Default: ""
894
895 • Type: String
896
897
898 The value npm init should use by default for the package author's name.
899 <!-- automatically generated, do not edit manually --> <!-- see
900 lib/utils/config/definitions.js -->
901
902
903 init-author-url
904 • Default: ""
905
906 • Type: "" or URL
907
908
909 The value npm init should use by default for the package author's home‐
910 page. <!-- automatically generated, do not edit manually --> <!-- see
911 lib/utils/config/definitions.js -->
912
913
914 init-license
915 • Default: "ISC"
916
917 • Type: String
918
919
920 The value npm init should use by default for the package license. <!--
921 automatically generated, do not edit manually --> <!-- see
922 lib/utils/config/definitions.js -->
923
924
925 init-module
926 • Default: "~/.npm-init.js"
927
928 • Type: Path
929
930
931 A module that will be loaded by the npm init command. See the documen‐
932 tation for the init-package-json https://github.com/npm/init-pack‐
933 age-json module for more information, or npm help init. <!-- automati‐
934 cally generated, do not edit manually --> <!-- see lib/utils/con‐
935 fig/definitions.js -->
936
937
938 init-version
939 • Default: "1.0.0"
940
941 • Type: SemVer string
942
943
944 The value that npm init should use by default for the package version
945 number, if not already set in package.json. <!-- automatically gener‐
946 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
947 -->
948
949
950 json
951 • Default: false
952
953 • Type: Boolean
954
955
956 Whether or not to output JSON data, rather than the normal output.
957
958 • In npm pkg set it enables parsing set values with JSON.parse() before
959 saving them to your package.json.
960
961
962 Not supported by all npm commands. <!-- automatically generated, do
963 not edit manually --> <!-- see lib/utils/config/definitions.js -->
964
965
966 key
967 • Default: null
968
969 • Type: null or String
970
971
972 A client key to pass when accessing the registry. Values should be in
973 PEM format with newlines replaced by the string "\n". For example:
974
975 key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
976
977 It is not the path to a key file (and there is no "keyfile" option).
978 <!-- automatically generated, do not edit manually --> <!-- see
979 lib/utils/config/definitions.js -->
980
981
982 legacy-bundling
983 • Default: false
984
985 • Type: Boolean
986
987
988 Causes npm to install the package such that versions of npm prior to
989 1.4, such as the one included with node 0.8, can install the package.
990 This eliminates all automatic deduping. If used with global-style this
991 option will be preferred. <!-- automatically generated, do not edit
992 manually --> <!-- see lib/utils/config/definitions.js -->
993
994
995 legacy-peer-deps
996 • Default: false
997
998 • Type: Boolean
999
1000
1001 Causes npm to completely ignore peerDependencies when building a pack‐
1002 age tree, as in npm versions 3 through 6.
1003
1004 If a package cannot be installed because of overly strict peerDependen‐
1005 cies that collide, it provides a way to move forward resolving the sit‐
1006 uation.
1007
1008 This differs from --omit=peer, in that --omit=peer will avoid unpacking
1009 peerDependencies on disk, but will still design a tree such that
1010 peerDependencies could be unpacked in a correct place.
1011
1012 Use of legacy-peer-deps is not recommended, as it will not enforce the
1013 peerDependencies contract that meta-dependencies may rely on. <!-- au‐
1014 tomatically generated, do not edit manually --> <!-- see lib/utils/con‐
1015 fig/definitions.js -->
1016
1017
1018 link
1019 • Default: false
1020
1021 • Type: Boolean
1022
1023
1024 Used with npm ls, limiting output to only those packages that are
1025 linked. <!-- automatically generated, do not edit manually --> <!--
1026 see lib/utils/config/definitions.js -->
1027
1028
1029 local-address
1030 • Default: null
1031
1032 • Type: IP Address
1033
1034
1035 The IP address of the local interface to use when making connections to
1036 the npm registry. Must be IPv4 in versions of Node prior to 0.12. <!--
1037 automatically generated, do not edit manually --> <!-- see
1038 lib/utils/config/definitions.js -->
1039
1040
1041 location
1042 • Default: "user" unless --global is passed, which will also set this
1043 value to "global"
1044
1045 • Type: "global", "user", or "project"
1046
1047
1048 When passed to npm config this refers to which config file to use.
1049 <!-- automatically generated, do not edit manually --> <!-- see
1050 lib/utils/config/definitions.js -->
1051
1052
1053 loglevel
1054 • Default: "notice"
1055
1056 • Type: "silent", "error", "warn", "notice", "http", "timing", "info",
1057 "verbose", or "silly"
1058
1059
1060 What level of logs to report. On failure, all logs are written to
1061 npm-debug.log in the current working directory.
1062
1063 Any logs of a higher level than the setting are shown. The default is
1064 "notice".
1065
1066 See also the foreground-scripts config. <!-- automatically generated,
1067 do not edit manually --> <!-- see lib/utils/config/definitions.js -->
1068
1069
1070 logs-max
1071 • Default: 10
1072
1073 • Type: Number
1074
1075
1076 The maximum number of log files to store. <!-- automatically gener‐
1077 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
1078 -->
1079
1080
1081 long
1082 • Default: false
1083
1084 • Type: Boolean
1085
1086
1087 Show extended information in ls, search, and help-search. <!-- auto‐
1088 matically generated, do not edit manually --> <!-- see lib/utils/con‐
1089 fig/definitions.js -->
1090
1091
1092 maxsockets
1093 • Default: 15
1094
1095 • Type: Number
1096
1097
1098 The maximum number of connections to use per origin (protocol/host/port
1099 combination). <!-- automatically generated, do not edit manually -->
1100 <!-- see lib/utils/config/definitions.js -->
1101
1102
1103 message
1104 • Default: "%s"
1105
1106 • Type: String
1107
1108
1109 Commit message which is used by npm version when creating version com‐
1110 mit.
1111
1112 Any "%s" in the message will be replaced with the version number. <!--
1113 automatically generated, do not edit manually --> <!-- see
1114 lib/utils/config/definitions.js -->
1115
1116
1117 node-options
1118 • Default: null
1119
1120 • Type: null or String
1121
1122
1123 Options to pass through to Node.js via the NODE_OPTIONS environment
1124 variable. This does not impact how npm itself is executed but it does
1125 impact how lifecycle scripts are called. <!-- automatically generated,
1126 do not edit manually --> <!-- see lib/utils/config/definitions.js -->
1127
1128
1129 node-version
1130 • Default: Node.js process.version value
1131
1132 • Type: SemVer string
1133
1134
1135 The node version to use when checking a package's engines setting.
1136 <!-- automatically generated, do not edit manually --> <!-- see
1137 lib/utils/config/definitions.js -->
1138
1139
1140 noproxy
1141 • Default: The value of the NO_PROXY environment variable
1142
1143 • Type: String (can be set multiple times)
1144
1145
1146 Domain extensions that should bypass any proxies.
1147
1148 Also accepts a comma-delimited string. <!-- automatically generated,
1149 do not edit manually --> <!-- see lib/utils/config/definitions.js -->
1150
1151
1152 npm-version
1153 • Default: Output of npm --version
1154
1155 • Type: SemVer string
1156
1157
1158 The npm version to use when checking a package's engines setting. <!--
1159 automatically generated, do not edit manually --> <!-- see
1160 lib/utils/config/definitions.js -->
1161
1162
1163 offline
1164 • Default: false
1165
1166 • Type: Boolean
1167
1168
1169 Force offline mode: no network requests will be done during install. To
1170 allow the CLI to fill in missing cache data, see --prefer-offline.
1171 <!-- automatically generated, do not edit manually --> <!-- see
1172 lib/utils/config/definitions.js -->
1173
1174
1175 omit
1176 • Default: 'dev' if the NODE_ENV environment variable is set to 'pro‐
1177 duction', otherwise empty.
1178
1179 • Type: "dev", "optional", or "peer" (can be set multiple times)
1180
1181
1182 Dependency types to omit from the installation tree on disk.
1183
1184 Note that these dependencies are still resolved and added to the pack‐
1185 age-lock.json or npm-shrinkwrap.json file. They are just not physically
1186 installed on disk.
1187
1188 If a package type appears in both the --include and --omit lists, then
1189 it will be included.
1190
1191 If the resulting omit list includes 'dev', then the NODE_ENV environ‐
1192 ment variable will be set to 'production' for all lifecycle scripts.
1193 <!-- automatically generated, do not edit manually --> <!-- see
1194 lib/utils/config/definitions.js -->
1195
1196
1197 otp
1198 • Default: null
1199
1200 • Type: null or String
1201
1202
1203 This is a one-time password from a two-factor authenticator. It's
1204 needed when publishing or changing package permissions with npm access.
1205
1206 If not set, and a registry response fails with a challenge for a
1207 one-time password, npm will prompt on the command line for one. <!--
1208 automatically generated, do not edit manually --> <!-- see
1209 lib/utils/config/definitions.js -->
1210
1211
1212 pack-destination
1213 • Default: "."
1214
1215 • Type: String
1216
1217
1218 Directory in which npm pack will save tarballs. <!-- automatically
1219 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
1220 tions.js -->
1221
1222
1223 package
1224 • Default:
1225
1226 • Type: String (can be set multiple times)
1227
1228
1229 The package to install for npm help exec <!-- automatically generated,
1230 do not edit manually --> <!-- see lib/utils/config/definitions.js -->
1231
1232
1233 package-lock
1234 • Default: true
1235
1236 • Type: Boolean
1237
1238
1239 If set to false, then ignore package-lock.json files when installing.
1240 This will also prevent writing package-lock.json if save is true.
1241
1242 When package package-locks are disabled, automatic pruning of extrane‐
1243 ous modules will also be disabled. To remove extraneous modules with
1244 package-locks disabled use npm prune. <!-- automatically generated, do
1245 not edit manually --> <!-- see lib/utils/config/definitions.js -->
1246
1247
1248 package-lock-only
1249 • Default: false
1250
1251 • Type: Boolean
1252
1253
1254 If set to true, the current operation will only use the pack‐
1255 age-lock.json, ignoring node_modules.
1256
1257 For update this means only the package-lock.json will be updated, in‐
1258 stead of checking node_modules and downloading dependencies.
1259
1260 For list this means the output will be based on the tree described by
1261 the package-lock.json, rather than the contents of node_modules. <!--
1262 automatically generated, do not edit manually --> <!-- see
1263 lib/utils/config/definitions.js -->
1264
1265
1266 parseable
1267 • Default: false
1268
1269 • Type: Boolean
1270
1271
1272 Output parseable results from commands that write to standard output.
1273 For npm search, this will be tab-separated table format. <!-- automat‐
1274 ically generated, do not edit manually --> <!-- see lib/utils/con‐
1275 fig/definitions.js -->
1276
1277
1278 prefer-offline
1279 • Default: false
1280
1281 • Type: Boolean
1282
1283
1284 If true, staleness checks for cached data will be bypassed, but missing
1285 data will be requested from the server. To force full offline mode, use
1286 --offline. <!-- automatically generated, do not edit manually --> <!--
1287 see lib/utils/config/definitions.js -->
1288
1289
1290 prefer-online
1291 • Default: false
1292
1293 • Type: Boolean
1294
1295
1296 If true, staleness checks for cached data will be forced, making the
1297 CLI look for updates immediately even for fresh package data. <!-- au‐
1298 tomatically generated, do not edit manually --> <!-- see lib/utils/con‐
1299 fig/definitions.js -->
1300
1301
1302 prefix
1303 • Default: In global mode, the folder where the node executable is in‐
1304 stalled. In local mode, the nearest parent folder containing either
1305 a package.json file or a node_modules folder.
1306
1307 • Type: Path
1308
1309
1310 The location to install global items. If set on the command line, then
1311 it forces non-global commands to run in the specified folder. <!-- au‐
1312 tomatically generated, do not edit manually --> <!-- see lib/utils/con‐
1313 fig/definitions.js -->
1314
1315
1316 preid
1317 • Default: ""
1318
1319 • Type: String
1320
1321
1322 The "prerelease identifier" to use as a prefix for the "prerelease"
1323 part of a semver. Like the rc in 1.2.0-rc.8. <!-- automatically gener‐
1324 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
1325 -->
1326
1327
1328 progress
1329 • Default: true unless running in a known CI system
1330
1331 • Type: Boolean
1332
1333
1334 When set to true, npm will display a progress bar during time intensive
1335 operations, if process.stderr is a TTY.
1336
1337 Set to false to suppress the progress bar. <!-- automatically gener‐
1338 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
1339 -->
1340
1341
1342 proxy
1343 • Default: null
1344
1345 • Type: null, false, or URL
1346
1347
1348 A proxy to use for outgoing http requests. If the HTTP_PROXY or
1349 http_proxy environment variables are set, proxy settings will be hon‐
1350 ored by the underlying request library. <!-- automatically generated,
1351 do not edit manually --> <!-- see lib/utils/config/definitions.js -->
1352
1353
1354 read-only
1355 • Default: false
1356
1357 • Type: Boolean
1358
1359
1360 This is used to mark a token as unable to publish when configuring lim‐
1361 ited access tokens with the npm token create command. <!-- automati‐
1362 cally generated, do not edit manually --> <!-- see lib/utils/con‐
1363 fig/definitions.js -->
1364
1365
1366 rebuild-bundle
1367 • Default: true
1368
1369 • Type: Boolean
1370
1371
1372 Rebuild bundled dependencies after installation. <!-- automatically
1373 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
1374 tions.js -->
1375
1376
1377 registry
1378 • Default: "https://registry.npmjs.org/"
1379
1380 • Type: URL
1381
1382
1383 The base URL of the npm registry. <!-- automatically generated, do not
1384 edit manually --> <!-- see lib/utils/config/definitions.js -->
1385
1386
1387 save
1388 • Default: true
1389
1390 • Type: Boolean
1391
1392
1393 Save installed packages to a package.json file as dependencies.
1394
1395 When used with the npm rm command, removes the dependency from pack‐
1396 age.json. <!-- automatically generated, do not edit manually --> <!--
1397 see lib/utils/config/definitions.js -->
1398
1399
1400 save-bundle
1401 • Default: false
1402
1403 • Type: Boolean
1404
1405
1406 If a package would be saved at install time by the use of --save,
1407 --save-dev, or --save-optional, then also put it in the bundleDependen‐
1408 cies list.
1409
1410 Ignore if --save-peer is set, since peerDependencies cannot be bundled.
1411 <!-- automatically generated, do not edit manually --> <!-- see
1412 lib/utils/config/definitions.js -->
1413
1414
1415 save-dev
1416 • Default: false
1417
1418 • Type: Boolean
1419
1420
1421 Save installed packages to a package.json file as devDependencies.
1422 <!-- automatically generated, do not edit manually --> <!-- see
1423 lib/utils/config/definitions.js -->
1424
1425
1426 save-exact
1427 • Default: false
1428
1429 • Type: Boolean
1430
1431
1432 Dependencies saved to package.json will be configured with an exact
1433 version rather than using npm's default semver range operator. <!--
1434 automatically generated, do not edit manually --> <!-- see
1435 lib/utils/config/definitions.js -->
1436
1437
1438 save-optional
1439 • Default: false
1440
1441 • Type: Boolean
1442
1443
1444 Save installed packages to a package.json file as optionalDependencies.
1445 <!-- automatically generated, do not edit manually --> <!-- see
1446 lib/utils/config/definitions.js -->
1447
1448
1449 save-peer
1450 • Default: false
1451
1452 • Type: Boolean
1453
1454
1455 Save installed packages. to a package.json file as peerDependencies
1456 <!-- automatically generated, do not edit manually --> <!-- see
1457 lib/utils/config/definitions.js -->
1458
1459
1460 save-prefix
1461 • Default: "^"
1462
1463 • Type: String
1464
1465
1466 Configure how versions of packages installed to a package.json file via
1467 --save or --save-dev get prefixed.
1468
1469 For example if a package has version 1.2.3, by default its version is
1470 set to ^1.2.3 which allows minor upgrades for that package, but after
1471 npm config set save-prefix='~' it would be set to ~1.2.3 which only al‐
1472 lows patch upgrades. <!-- automatically generated, do not edit manu‐
1473 ally --> <!-- see lib/utils/config/definitions.js -->
1474
1475
1476 save-prod
1477 • Default: false
1478
1479 • Type: Boolean
1480
1481
1482 Save installed packages into dependencies specifically. This is useful
1483 if a package already exists in devDependencies or optionalDependencies,
1484 but you want to move it to be a non-optional production dependency.
1485
1486 This is the default behavior if --save is true, and neither --save-dev
1487 or --save-optional are true. <!-- automatically generated, do not edit
1488 manually --> <!-- see lib/utils/config/definitions.js -->
1489
1490
1491 scope
1492 • Default: the scope of the current project, if any, or ""
1493
1494 • Type: String
1495
1496
1497 Associate an operation with a scope for a scoped registry.
1498
1499 Useful when logging in to or out of a private registry:
1500
1501 # log in, linking the scope to the custom registry
1502 npm login --scope=@mycorp --registry=https://registry.mycorp.com
1503
1504 # log out, removing the link and the auth token
1505 npm logout --scope=@mycorp
1506
1507 This will cause @mycorp to be mapped to the registry for future instal‐
1508 lation of packages specified according to the pattern @mycorp/package.
1509
1510 This will also cause npm init to create a scoped package.
1511
1512 # accept all defaults, and create a package named "@foo/whatever",
1513 # instead of just named "whatever"
1514 npm init --scope=@foo --yes
1515 <!-- automatically generated, do not edit manually --> <!-- see
1516 lib/utils/config/definitions.js -->
1517
1518
1519 script-shell
1520 • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
1521
1522 • Type: null or String
1523
1524
1525 The shell to use for scripts run with the npm exec, npm run and npm
1526 init <pkg> commands. <!-- automatically generated, do not edit manu‐
1527 ally --> <!-- see lib/utils/config/definitions.js -->
1528
1529
1530 searchexclude
1531 • Default: ""
1532
1533 • Type: String
1534
1535
1536 Space-separated options that limit the results from search. <!-- auto‐
1537 matically generated, do not edit manually --> <!-- see lib/utils/con‐
1538 fig/definitions.js -->
1539
1540
1541 searchlimit
1542 • Default: 20
1543
1544 • Type: Number
1545
1546
1547 Number of items to limit search results to. Will not apply at all to
1548 legacy searches. <!-- automatically generated, do not edit manually
1549 --> <!-- see lib/utils/config/definitions.js -->
1550
1551
1552 searchopts
1553 • Default: ""
1554
1555 • Type: String
1556
1557
1558 Space-separated options that are always passed to search. <!-- auto‐
1559 matically generated, do not edit manually --> <!-- see lib/utils/con‐
1560 fig/definitions.js -->
1561
1562
1563 searchstaleness
1564 • Default: 900
1565
1566 • Type: Number
1567
1568
1569 The age of the cache, in seconds, before another registry request is
1570 made if using legacy search endpoint. <!-- automatically generated, do
1571 not edit manually --> <!-- see lib/utils/config/definitions.js -->
1572
1573
1574 shell
1575 • Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe"
1576 on Windows
1577
1578 • Type: String
1579
1580
1581 The shell to run for the npm explore command. <!-- automatically gen‐
1582 erated, do not edit manually --> <!-- see lib/utils/config/defini‐
1583 tions.js -->
1584
1585
1586 sign-git-commit
1587 • Default: false
1588
1589 • Type: Boolean
1590
1591
1592 If set to true, then the npm version command will commit the new pack‐
1593 age version using -S to add a signature.
1594
1595 Note that git requires you to have set up GPG keys in your git configs
1596 for this to work properly. <!-- automatically generated, do not edit
1597 manually --> <!-- see lib/utils/config/definitions.js -->
1598
1599
1600 sign-git-tag
1601 • Default: false
1602
1603 • Type: Boolean
1604
1605
1606 If set to true, then the npm version command will tag the version using
1607 -s to add a signature.
1608
1609 Note that git requires you to have set up GPG keys in your git configs
1610 for this to work properly. <!-- automatically generated, do not edit
1611 manually --> <!-- see lib/utils/config/definitions.js -->
1612
1613
1614 strict-peer-deps
1615 • Default: false
1616
1617 • Type: Boolean
1618
1619
1620 If set to true, and --legacy-peer-deps is not set, then any conflicting
1621 peerDependencies will be treated as an install failure, even if npm
1622 could reasonably guess the appropriate resolution based on non-peer de‐
1623 pendency relationships.
1624
1625 By default, conflicting peerDependencies deep in the dependency graph
1626 will be resolved using the nearest non-peer dependency specification,
1627 even if doing so will result in some packages receiving a peer depen‐
1628 dency outside the range set in their package's peerDependencies object.
1629
1630 When such and override is performed, a warning is printed, explaining
1631 the conflict and the packages involved. If --strict-peer-deps is set,
1632 then this warning is treated as a failure. <!-- automatically gener‐
1633 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
1634 -->
1635
1636
1637 strict-ssl
1638 • Default: true
1639
1640 • Type: Boolean
1641
1642
1643 Whether or not to do SSL key validation when making requests to the
1644 registry via https.
1645
1646 See also the ca config. <!-- automatically generated, do not edit man‐
1647 ually --> <!-- see lib/utils/config/definitions.js -->
1648
1649
1650 tag
1651 • Default: "latest"
1652
1653 • Type: String
1654
1655
1656 If you ask npm to install a package and don't tell it a specific ver‐
1657 sion, then it will install the specified tag.
1658
1659 Also the tag that is added to the package@version specified by the npm
1660 tag command, if no explicit tag is given.
1661
1662 When used by the npm diff command, this is the tag used to fetch the
1663 tarball that will be compared with the local files by default. <!--
1664 automatically generated, do not edit manually --> <!-- see
1665 lib/utils/config/definitions.js -->
1666
1667
1668 tag-version-prefix
1669 • Default: "v"
1670
1671 • Type: String
1672
1673
1674 If set, alters the prefix used when tagging a new version when perform‐
1675 ing a version increment using npm-version. To remove the prefix alto‐
1676 gether, set it to the empty string: "".
1677
1678 Because other tools may rely on the convention that npm version tags
1679 look like v1.0.0, only use this property if it is absolutely necessary.
1680 In particular, use care when overriding this setting for public pack‐
1681 ages. <!-- automatically generated, do not edit manually --> <!-- see
1682 lib/utils/config/definitions.js -->
1683
1684
1685 timing
1686 • Default: false
1687
1688 • Type: Boolean
1689
1690
1691 If true, writes an npm-debug log to _logs and timing information to
1692 _timing.json, both in your cache, even if the command completes suc‐
1693 cessfully. _timing.json is a newline delimited list of JSON objects.
1694
1695 You can quickly view it with this json https://npm.im/json command
1696 line: npm exec -- json -g < ~/.npm/_timing.json. <!-- automatically
1697 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
1698 tions.js -->
1699
1700
1701 umask
1702 • Default: 0
1703
1704 • Type: Octal numeric string in range 0000..0777 (0..511)
1705
1706
1707 The "umask" value to use when setting the file creation mode on files
1708 and folders.
1709
1710 Folders and executables are given a mode which is 0o777 masked against
1711 this value. Other files are given a mode which is 0o666 masked against
1712 this value.
1713
1714 Note that the underlying system will also apply its own umask value to
1715 files and folders that are created, and npm does not circumvent this,
1716 but rather adds the --umask config to it.
1717
1718 Thus, the effective default umask value on most POSIX systems is 0o22,
1719 meaning that folders and executables are created with a mode of 0o755
1720 and other files are created with a mode of 0o644. <!-- automatically
1721 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
1722 tions.js -->
1723
1724
1725 unicode
1726 • Default: false on windows, true on mac/unix systems with a unicode
1727 locale, as defined by the LC_ALL, LC_CTYPE, or LANG environment vari‐
1728 ables.
1729
1730 • Type: Boolean
1731
1732
1733 When set to true, npm uses unicode characters in the tree output. When
1734 false, it uses ascii characters instead of unicode glyphs. <!-- auto‐
1735 matically generated, do not edit manually --> <!-- see lib/utils/con‐
1736 fig/definitions.js -->
1737
1738
1739 update-notifier
1740 • Default: true
1741
1742 • Type: Boolean
1743
1744
1745 Set to false to suppress the update notification when using an older
1746 version of npm than the latest. <!-- automatically generated, do not
1747 edit manually --> <!-- see lib/utils/config/definitions.js -->
1748
1749
1750 usage
1751 • Default: false
1752
1753 • Type: Boolean
1754
1755
1756 Show short usage output about the command specified. <!-- automati‐
1757 cally generated, do not edit manually --> <!-- see lib/utils/con‐
1758 fig/definitions.js -->
1759
1760
1761 user-agent
1762 • Default: "npm/{npm-version} node/{node-version} {platform} {arch}
1763 workspaces/{workspaces} {ci}"
1764
1765 • Type: String
1766
1767
1768 Sets the User-Agent request header. The following fields are replaced
1769 with their actual counterparts:
1770
1771 • {npm-version} - The npm version in use
1772
1773 • {node-version} - The Node.js version in use
1774
1775 • {platform} - The value of process.platform
1776
1777 • {arch} - The value of process.arch
1778
1779 • {workspaces} - Set to true if the workspaces or workspace options are
1780 set.
1781
1782 • {ci} - The value of the ci-name config, if set, prefixed with ci/, or
1783 an empty string if ci-name is empty.
1784
1785 <!-- automatically generated, do not edit manually --> <!-- see
1786 lib/utils/config/definitions.js -->
1787
1788
1789 userconfig
1790 • Default: "~/.npmrc"
1791
1792 • Type: Path
1793
1794
1795 The location of user-level configuration settings.
1796
1797 This may be overridden by the npm_config_userconfig environment vari‐
1798 able or the --userconfig command line option, but may not be overridden
1799 by settings in the globalconfig file. <!-- automatically generated, do
1800 not edit manually --> <!-- see lib/utils/config/definitions.js -->
1801
1802
1803 version
1804 • Default: false
1805
1806 • Type: Boolean
1807
1808
1809 If true, output the npm version and exit successfully.
1810
1811 Only relevant when specified explicitly on the command line. <!-- au‐
1812 tomatically generated, do not edit manually --> <!-- see lib/utils/con‐
1813 fig/definitions.js -->
1814
1815
1816 versions
1817 • Default: false
1818
1819 • Type: Boolean
1820
1821
1822 If true, output the npm version as well as node's process.versions map
1823 and the version in the current working directory's package.json file if
1824 one exists, and exit successfully.
1825
1826 Only relevant when specified explicitly on the command line. <!-- au‐
1827 tomatically generated, do not edit manually --> <!-- see lib/utils/con‐
1828 fig/definitions.js -->
1829
1830
1831 viewer
1832 • Default: "man" on Posix, "browser" on Windows
1833
1834 • Type: String
1835
1836
1837 The program to use to view help content.
1838
1839 Set to "browser" to view html help content in the default web browser.
1840 <!-- automatically generated, do not edit manually --> <!-- see
1841 lib/utils/config/definitions.js -->
1842
1843
1844 which
1845 • Default: null
1846
1847 • Type: null or Number
1848
1849
1850 If there are multiple funding sources, which 1-indexed source URL to
1851 open. <!-- automatically generated, do not edit manually --> <!-- see
1852 lib/utils/config/definitions.js -->
1853
1854
1855 workspace
1856 • Default:
1857
1858 • Type: String (can be set multiple times)
1859
1860
1861 Enable running a command in the context of the configured workspaces of
1862 the current project while filtering by running only the workspaces de‐
1863 fined by this configuration option.
1864
1865 Valid values for the workspace config are either:
1866
1867 • Workspace names
1868
1869 • Path to a workspace directory
1870
1871 • Path to a parent workspace directory (will result to selecting all of
1872 the nested workspaces)
1873
1874
1875 When set for the npm init command, this may be set to the folder of a
1876 workspace which does not yet exist, to create the folder and set it up
1877 as a brand new workspace within the project.
1878
1879 This value is not exported to the environment for child processes.
1880 <!-- automatically generated, do not edit manually --> <!-- see
1881 lib/utils/config/definitions.js -->
1882
1883
1884 workspaces
1885 • Default: false
1886
1887 • Type: Boolean
1888
1889
1890 Enable running a command in the context of all the configured
1891 workspaces.
1892
1893 This value is not exported to the environment for child processes.
1894 <!-- automatically generated, do not edit manually --> <!-- see
1895 lib/utils/config/definitions.js -->
1896
1897
1898 yes
1899 • Default: null
1900
1901 • Type: null or Boolean
1902
1903
1904 Automatically answer "yes" to any prompts that npm might print on the
1905 command line. <!-- automatically generated, do not edit manually -->
1906 <!-- see lib/utils/config/definitions.js -->
1907
1908
1909 also
1910 • Default: null
1911
1912 • Type: null, "dev", or "development"
1913
1914 • DEPRECATED: Please use --include=dev instead.
1915
1916
1917 When set to dev or development, this is an alias for --include=dev.
1918 <!-- automatically generated, do not edit manually --> <!-- see
1919 lib/utils/config/definitions.js -->
1920
1921
1922 auth-type
1923 • Default: "legacy"
1924
1925 • Type: "legacy", "sso", "saml", or "oauth"
1926
1927 • DEPRECATED: This method of SSO/SAML/OAuth is deprecated and will be
1928 removed in a future version of npm in favor of web-based login.
1929
1930
1931 What authentication strategy to use with adduser/login. <!-- automati‐
1932 cally generated, do not edit manually --> <!-- see lib/utils/con‐
1933 fig/definitions.js -->
1934
1935
1936 cache-max
1937 • Default: Infinity
1938
1939 • Type: Number
1940
1941 • DEPRECATED: This option has been deprecated in favor of --prefer-on‐
1942 line
1943
1944
1945 --cache-max=0 is an alias for --prefer-online <!-- automatically gener‐
1946 ated, do not edit manually --> <!-- see lib/utils/config/definitions.js
1947 -->
1948
1949
1950 cache-min
1951 • Default: 0
1952
1953 • Type: Number
1954
1955 • DEPRECATED: This option has been deprecated in favor of --prefer-off‐
1956 line.
1957
1958
1959 --cache-min=9999 (or bigger) is an alias for --prefer-offline. <!--
1960 automatically generated, do not edit manually --> <!-- see
1961 lib/utils/config/definitions.js -->
1962
1963
1964 dev
1965 • Default: false
1966
1967 • Type: Boolean
1968
1969 • DEPRECATED: Please use --include=dev instead.
1970
1971
1972 Alias for --include=dev. <!-- automatically generated, do not edit
1973 manually --> <!-- see lib/utils/config/definitions.js -->
1974
1975
1976 init.author.email
1977 • Default: ""
1978
1979 • Type: String
1980
1981 • DEPRECATED: Use --init-author-email instead.
1982
1983
1984 Alias for --init-author-email <!-- automatically generated, do not edit
1985 manually --> <!-- see lib/utils/config/definitions.js -->
1986
1987
1988 init.author.name
1989 • Default: ""
1990
1991 • Type: String
1992
1993 • DEPRECATED: Use --init-author-name instead.
1994
1995
1996 Alias for --init-author-name <!-- automatically generated, do not edit
1997 manually --> <!-- see lib/utils/config/definitions.js -->
1998
1999
2000 init.author.url
2001 • Default: ""
2002
2003 • Type: "" or URL
2004
2005 • DEPRECATED: Use --init-author-url instead.
2006
2007
2008 Alias for --init-author-url <!-- automatically generated, do not edit
2009 manually --> <!-- see lib/utils/config/definitions.js -->
2010
2011
2012 init.license
2013 • Default: "ISC"
2014
2015 • Type: String
2016
2017 • DEPRECATED: Use --init-license instead.
2018
2019
2020 Alias for --init-license <!-- automatically generated, do not edit man‐
2021 ually --> <!-- see lib/utils/config/definitions.js -->
2022
2023
2024 init.module
2025 • Default: "~/.npm-init.js"
2026
2027 • Type: Path
2028
2029 • DEPRECATED: Use --init-module instead.
2030
2031
2032 Alias for --init-module <!-- automatically generated, do not edit manu‐
2033 ally --> <!-- see lib/utils/config/definitions.js -->
2034
2035
2036 init.version
2037 • Default: "1.0.0"
2038
2039 • Type: SemVer string
2040
2041 • DEPRECATED: Use --init-version instead.
2042
2043
2044 Alias for --init-version <!-- automatically generated, do not edit man‐
2045 ually --> <!-- see lib/utils/config/definitions.js -->
2046
2047
2048 only
2049 • Default: null
2050
2051 • Type: null, "prod", or "production"
2052
2053 • DEPRECATED: Use --omit=dev to omit dev dependencies from the install.
2054
2055
2056 When set to prod or production, this is an alias for --omit=dev. <!--
2057 automatically generated, do not edit manually --> <!-- see
2058 lib/utils/config/definitions.js -->
2059
2060
2061 optional
2062 • Default: null
2063
2064 • Type: null or Boolean
2065
2066 • DEPRECATED: Use --omit=optional to exclude optional dependencies, or
2067 --include=optional to include them.
2068
2069
2070 Default value does install optional deps unless otherwise omitted.
2071
2072 Alias for --include=optional or --omit=optional <!-- automatically gen‐
2073 erated, do not edit manually --> <!-- see lib/utils/config/defini‐
2074 tions.js -->
2075
2076
2077 production
2078 • Default: null
2079
2080 • Type: null or Boolean
2081
2082 • DEPRECATED: Use --omit=dev instead.
2083
2084
2085 Alias for --omit=dev <!-- automatically generated, do not edit manually
2086 --> <!-- see lib/utils/config/definitions.js -->
2087
2088
2089 shrinkwrap
2090 • Default: true
2091
2092 • Type: Boolean
2093
2094 • DEPRECATED: Use the --package-lock setting instead.
2095
2096
2097 Alias for --package-lock <!-- automatically generated, do not edit man‐
2098 ually --> <!-- see lib/utils/config/definitions.js -->
2099
2100
2101 sso-poll-frequency
2102 • Default: 500
2103
2104 • Type: Number
2105
2106 • DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed
2107 in a future version of npm in favor of web-based login.
2108
2109
2110 When used with SSO-enabled auth-types, configures how regularly the
2111 registry should be polled while the user is completing authentication.
2112 <!-- automatically generated, do not edit manually --> <!-- see
2113 lib/utils/config/definitions.js -->
2114
2115
2116 sso-type
2117 • Default: "oauth"
2118
2119 • Type: null, "oauth", or "saml"
2120
2121 • DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed
2122 in a future version of npm in favor of web-based login.
2123
2124
2125 If --auth-type=sso, the type of SSO type to use. <!-- automatically
2126 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
2127 tions.js -->
2128
2129
2130 tmp
2131 • Default: The value returned by the Node.js os.tmpdir() method
2132 https://nodejs.org/api/os.html#os_os_tmpdir
2133
2134 • Type: Path
2135
2136 • DEPRECATED: This setting is no longer used. npm stores temporary
2137 files in a special location in the cache, and they are managed by ca‐
2138 cache http://npm.im/cacache.
2139
2140
2141 Historically, the location where temporary files were stored. No longer
2142 relevant. <!-- automatically generated, do not edit manually --> <!--
2143 see lib/utils/config/definitions.js --> <!-- AUTOGENERATED CONFIG DE‐
2144 SCRIPTIONS END -->
2145
2146
2147 See also
2148 • npm help config
2149
2150 • npm help npmrc
2151
2152 • npm help scripts
2153
2154 • npm help folders
2155
2156 • npm help npm
2157
2158
2159
2160
2161 October 2021 CONFIG(7)