1NPM-CONFIG(7) NPM-CONFIG(7)
2
3
4
6 npm-config - More than you probably want to know about npm configura‐
7 tion
8
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
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
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
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 foo@1.2 even
233 though latest is 2.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 format-package-lock
458 · Default: true
459
460 · Type: Boolean
461
462
463 Format package-lock.json or npm-shrinkwrap.json as a human readable
464 file.
465
466 fetch-retries
467 · Default: 2
468
469 · Type: Number
470
471
472 The "retries" config for the retry module to use when fetching packages
473 from the registry.
474
475 fetch-retry-factor
476 · Default: 10
477
478 · Type: Number
479
480
481 The "factor" config for the retry module to use when fetching packages.
482
483 fetch-retry-mintimeout
484 · Default: 10000 (10 seconds)
485
486 · Type: Number
487
488
489 The "minTimeout" config for the retry module to use when fetching pack‐
490 ages.
491
492 fetch-retry-maxtimeout
493 · Default: 60000 (1 minute)
494
495 · Type: Number
496
497
498 The "maxTimeout" config for the retry module to use when fetching pack‐
499 ages.
500
501 git
502 · Default: "git"
503
504 · Type: String
505
506
507 The command to use for git commands. If git is installed on the com‐
508 puter, but is not in the PATH, then set this to the full path to the
509 git binary.
510
511 git-tag-version
512 · Default: true
513
514 · Type: Boolean
515
516
517 Tag the commit when using the npm version command.
518
519 commit-hooks
520 · Default: true
521
522 · Type: Boolean
523
524
525 Run git commit hooks when using the npm version command.
526
527 global
528 · Default: false
529
530 · Type: Boolean
531
532
533 Operates in "global" mode, so that packages are installed into the pre‐
534 fix folder instead of the current working directory. See npm help 5
535 npm-folders for more on the differences in behavior.
536
537 · packages are installed into the {prefix}/lib/node_modules folder,
538 instead of the current working directory.
539
540 · bin files are linked to {prefix}/bin
541
542 · man pages are linked to {prefix}/share/man
543
544
545 globalconfig
546 · Default: {prefix}/etc/npmrc
547
548 · Type: path
549
550
551 The config file to read for global config options.
552
553 global-style
554 · Default: false
555
556 · Type: Boolean
557
558
559 Causes npm to install the package into your local node_modules folder
560 with the same layout it uses with the global node_modules folder. Only
561 your direct dependencies will show in node_modules and everything they
562 depend on will be flattened in their node_modules folders. This obvi‐
563 ously will eliminate some deduping. If used with legacy-bundling,
564 legacy-bundling will be preferred.
565
566 group
567 · Default: GID of the current process
568
569 · Type: String or Number
570
571
572 The group to use when running package scripts in global mode as the
573 root user.
574
575 heading
576 · Default: "npm"
577
578 · Type: String
579
580
581 The string that starts all the debugging log output.
582
583 https-proxy
584 · Default: null
585
586 · Type: url
587
588
589 A proxy to use for outgoing https requests. If the HTTPS_PROXY or
590 https_proxy or HTTP_PROXY or http_proxy environment variables are set,
591 proxy settings will be honored by the underlying request library.
592
593 if-present
594 · Default: false
595
596 · Type: Boolean
597
598
599 If true, npm will not exit with an error code when run-script is
600 invoked for a script that isn't defined in the scripts section of pack‐
601 age.json. This option can be used when it's desirable to optionally run
602 a script when it's present and fail if the script fails. This is use‐
603 ful, for example, when running scripts that may only apply for some
604 builds in an otherwise generic CI setup.
605
606 ignore-prepublish
607 · Default: false
608
609 · Type: Boolean
610
611
612 If true, npm will not run prepublish scripts.
613
614 ignore-scripts
615 · Default: false
616
617 · Type: Boolean
618
619
620 If true, npm does not run scripts specified in package.json files.
621
622 init-module
623 · Default: ~/.npm-init.js
624
625 · Type: path
626
627
628 A module that will be loaded by the npm init command. See the documen‐
629 tation for the init-package-json https://github.com/isaacs/init-pack‐
630 age-json module for more information, or npm help init.
631
632 init-author-name
633 · Default: ""
634
635 · Type: String
636
637
638 The value npm init should use by default for the package author's name.
639
640 init-author-email
641 · Default: ""
642
643 · Type: String
644
645
646 The value npm init should use by default for the package author's
647 email.
648
649 init-author-url
650 · Default: ""
651
652 · Type: String
653
654
655 The value npm init should use by default for the package author's home‐
656 page.
657
658 init-license
659 · Default: "ISC"
660
661 · Type: String
662
663
664 The value npm init should use by default for the package license.
665
666 init-version
667 · Default: "1.0.0"
668
669 · Type: semver
670
671
672 The value that npm init should use by default for the package version
673 number, if not already set in package.json.
674
675 json
676 · Default: false
677
678 · Type: Boolean
679
680
681 Whether or not to output JSON data, rather than the normal output.
682
683 This feature is currently experimental, and the output data structures
684 for many commands is either not implemented in JSON yet, or subject to
685 change. Only the output from npm ls --json and npm search --json are
686 currently valid.
687
688 key
689 · Default: null
690
691 · Type: String
692
693
694 A client key to pass when accessing the registry. Values should be in
695 PEM format with newlines replaced by the string "\n". For example:
696
697 key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
698
699 It is not the path to a key file (and there is no "keyfile" option).
700
701 legacy-bundling
702 · Default: false
703
704 · Type: Boolean
705
706
707 Causes npm to install the package such that versions of npm prior to
708 1.4, such as the one included with node 0.8, can install the package.
709 This eliminates all automatic deduping. If used with global-style this
710 option will be preferred.
711
712 link
713 · Default: false
714
715 · Type: Boolean
716
717
718 If true, then local installs will link if there is a suitable globally
719 installed package.
720
721 Note that this means that local installs can cause things to be
722 installed into the global space at the same time. The link is only
723 done if one of the two conditions are met:
724
725 · The package is not already installed globally, or
726
727 · the globally installed version is identical to the version that is
728 being installed locally.
729
730
731 local-address
732 · Default: undefined
733
734 · Type: IP Address
735
736
737 The IP address of the local interface to use when making connections to
738 the npm registry. Must be IPv4 in versions of Node prior to 0.12.
739
740 loglevel
741 · Default: "notice"
742
743 · Type: String
744
745 · Values: "silent", "error", "warn", "notice", "http", "timing",
746 "info", "verbose", "silly"
747
748
749 What level of logs to report. On failure, all logs are written to
750 npm-debug.log in the current working directory.
751
752 Any logs of a higher level than the setting are shown. The default is
753 "notice".
754
755 logstream
756 · Default: process.stderr
757
758 · Type: Stream
759
760
761 This is the stream that is passed to the npmlog
762 https://github.com/npm/npmlog module at run time.
763
764 It cannot be set from the command line, but if you are using npm pro‐
765 grammatically, you may wish to send logs to somewhere other than
766 stderr.
767
768 If the color config is set to true, then this stream will receive col‐
769 ored output if it is a TTY.
770
771 logs-max
772 · Default: 10
773
774 · Type: Number
775
776
777 The maximum number of log files to store.
778
779 long
780 · Default: false
781
782 · Type: Boolean
783
784
785 Show extended information in npm ls and npm search.
786
787 maxsockets
788 · Default: 50
789
790 · Type: Number
791
792
793 The maximum number of connections to use per origin (protocol/host/port
794 combination). Passed to the http Agent used to make the request.
795
796 message
797 · Default: "%s"
798
799 · Type: String
800
801
802 Commit message which is used by npm version when creating version com‐
803 mit.
804
805 Any "%s" in the message will be replaced with the version number.
806
807 metrics-registry
808 · Default: The value of registry (which defaults to "https://reg‐
809 istry.npmjs.org/")
810
811 · Type: String
812
813
814 The registry you want to send cli metrics to if send-metrics is true.
815
816 node-options
817 · Default: null
818
819 · Type: String
820
821
822 Options to pass through to Node.js via the NODE_OPTIONS environment
823 variable. This does not impact how npm itself is executed but it does
824 impact how lifecycle scripts are called.
825
826 node-version
827 · Default: process.version
828
829 · Type: semver or false
830
831
832 The node version to use when checking a package's engines map.
833
834 noproxy
835 · Default: null
836
837 · Type: String or Array
838
839
840 A comma-separated string or an array of domain extensions that a proxy
841 should not be used for.
842
843 offline
844 · Default: false
845
846 · Type: Boolean
847
848
849 Force offline mode: no network requests will be done during install. To
850 allow the CLI to fill in missing cache data, see --prefer-offline.
851
852 onload-script
853 · Default: false
854
855 · Type: path
856
857
858 A node module to require() when npm loads. Useful for programmatic
859 usage.
860
861 only
862 · Default: null
863
864 · Type: String
865
866
867 When "dev" or "development" and running local npm install without any
868 arguments, only devDependencies (and their dependencies) are installed.
869
870 When "dev" or "development" and running local npm ls, npm outdated, or
871 npm update, is an alias for --dev.
872
873 When "prod" or "production" and running local npm install without any
874 arguments, only non-devDependencies (and their dependencies) are
875 installed.
876
877 When "prod" or "production" and running local npm ls, npm outdated, or
878 npm update, is an alias for --production.
879
880 optional
881 · Default: true
882
883 · Type: Boolean
884
885
886 Attempt to install packages in the optionalDependencies object. Note
887 that if these packages fail to install, the overall installation
888 process is not aborted.
889
890 otp
891 · Default: null
892
893 · Type: Number
894
895
896 This is a one-time password from a two-factor authenticator. It's
897 needed when publishing or changing package permissions with npm access.
898
899 package-lock
900 · Default: true
901
902 · Type: Boolean
903
904
905 If set to false, then ignore package-lock.json files when installing.
906 This will also prevent writing package-lock.json if save is true.
907
908 When package package-locks are disabled, automatic pruning of extrane‐
909 ous modules will also be disabled. To remove extraneous modules with
910 package-locks disabled use npm prune.
911
912 This option is an alias for --shrinkwrap.
913
914 package-lock-only
915 · Default: false
916
917 · Type: Boolean
918
919
920 If set to true, it will update only the package-lock.json, instead of
921 checking node_modules and downloading dependencies.
922
923 parseable
924 · Default: false
925
926 · Type: Boolean
927
928
929 Output parseable results from commands that write to standard output.
930 For npm search, this will be tab-separated table format.
931
932 prefer-offline
933 · Default: false
934
935 · Type: Boolean
936
937
938 If true, staleness checks for cached data will be bypassed, but missing
939 data will be requested from the server. To force full offline mode, use
940 --offline.
941
942 This option is effectively equivalent to --cache-min=9999999.
943
944 prefer-online
945 · Default: false
946
947 · Type: Boolean
948
949
950 If true, staleness checks for cached data will be forced, making the
951 CLI look for updates immediately even for fresh package data.
952
953 prefix
954 · Default: see npm help 5 folders
955
956 · Type: path
957
958
959 The location to install global items. If set on the command line, then
960 it forces non-global commands to run in the specified folder.
961
962 preid
963 · Default: ""
964
965 · Type: String
966
967
968 The "prerelease identifier" to use as a prefix for the "prerelease"
969 part of a semver. Like the rc in 1.2.0-rc.8.
970
971 production
972 · Default: false
973
974 · Type: Boolean
975
976
977 Set to true to run in "production" mode.
978
979 1. devDependencies are not installed at the topmost level when running
980 local npm install without any arguments.
981
982 2. Set the NODE_ENV="production" for lifecycle scripts.
983
984
985 progress
986 · Default: true, unless TRAVIS or CI env vars set.
987
988 · Type: Boolean
989
990
991 When set to true, npm will display a progress bar during time intensive
992 operations, if process.stderr is a TTY.
993
994 Set to false to suppress the progress bar.
995
996 proxy
997 · Default: null
998
999 · Type: url
1000
1001
1002 A proxy to use for outgoing http requests. If the HTTP_PROXY or
1003 http_proxy environment variables are set, proxy settings will be hon‐
1004 ored by the underlying request library.
1005
1006 read-only
1007 · Default: false
1008
1009 · Type: Boolean
1010
1011
1012 This is used to mark a token as unable to publish when configuring lim‐
1013 ited access tokens with the npm token create command.
1014
1015 rebuild-bundle
1016 · Default: true
1017
1018 · Type: Boolean
1019
1020
1021 Rebuild bundled dependencies after installation.
1022
1023 registry
1024 · Default: https://registry.npmjs.org/
1025
1026 · Type: url
1027
1028
1029 The base URL of the npm package registry.
1030
1031 rollback
1032 · Default: true
1033
1034 · Type: Boolean
1035
1036
1037 Remove failed installs.
1038
1039 save
1040 · Default: true
1041
1042 · Type: Boolean
1043
1044
1045 Save installed packages to a package.json file as dependencies.
1046
1047 When used with the npm rm command, it removes it from the dependencies
1048 object.
1049
1050 Only works if there is already a package.json file present.
1051
1052 save-bundle
1053 · Default: false
1054
1055 · Type: Boolean
1056
1057
1058 If a package would be saved at install time by the use of --save,
1059 --save-dev, or --save-optional, then also put it in the bundleDependen‐
1060 cies list.
1061
1062 When used with the npm rm command, it removes it from the bundledDepen‐
1063 dencies list.
1064
1065 save-prod
1066 · Default: false
1067
1068 · Type: Boolean
1069
1070
1071 Makes sure that a package will be saved into dependencies specifically.
1072 This is useful if a package already exists in devDependencies or
1073 optionalDependencies, but you want to move it to be a production dep.
1074 This is also the default behavior if --save is true, and neither
1075 --save-dev or --save-optional are true.
1076
1077 save-dev
1078 · Default: false
1079
1080 · Type: Boolean
1081
1082
1083 Save installed packages to a package.json file as devDependencies.
1084
1085 When used with the npm rm command, it removes it from the devDependen‐
1086 cies object.
1087
1088 Only works if there is already a package.json file present.
1089
1090 save-exact
1091 · Default: false
1092
1093 · Type: Boolean
1094
1095
1096 Dependencies saved to package.json using --save, --save-dev or
1097 --save-optional will be configured with an exact version rather than
1098 using npm's default semver range operator.
1099
1100 save-optional
1101 · Default: false
1102
1103 · Type: Boolean
1104
1105
1106 Save installed packages to a package.json file as optionalDependencies.
1107
1108 When used with the npm rm command, it removes it from the devDependen‐
1109 cies object.
1110
1111 Only works if there is already a package.json file present.
1112
1113 save-prefix
1114 · Default: '^'
1115
1116 · Type: String
1117
1118
1119 Configure how versions of packages installed to a package.json file via
1120 --save or --save-dev get prefixed.
1121
1122 For example if a package has version 1.2.3, by default its version is
1123 set to ^1.2.3 which allows minor upgrades for that package, but after
1124 npm config set save-prefix='~' it would be set to ~1.2.3 which only
1125 allows patch upgrades.
1126
1127 scope
1128 · Default: the scope of the current project, if any, or ""
1129
1130 · Type: String
1131
1132
1133 Associate an operation with a scope for a scoped registry. Useful when
1134 logging in to a private registry for the first time: npm login
1135 --scope=@organization --registry=registry.organization.com, which will
1136 cause @organization to be mapped to the registry for future installa‐
1137 tion of packages specified according to the pattern @organization/pack‐
1138 age.
1139
1140 script-shell
1141 · Default: null
1142
1143 · Type: path
1144
1145
1146 The shell to use for scripts run with the npm run command.
1147
1148 scripts-prepend-node-path
1149 · Default: "warn-only"
1150
1151 · Type: Boolean, "auto" or "warn-only"
1152
1153
1154 If set to true, add the directory in which the current node executable
1155 resides to the PATH environment variable when running scripts, even if
1156 that means that npm will invoke a different node executable than the
1157 one which it is running.
1158
1159 If set to false, never modify PATH with that.
1160
1161 If set to "warn-only", never modify PATH but print a warning if npm
1162 thinks that you may want to run it with true, e.g. because the node
1163 executable in the PATH is not the one npm was invoked with.
1164
1165 If set to auto, only add that directory to the PATH environment vari‐
1166 able if the node executable with which npm was invoked and the one that
1167 is found first on the PATH are different.
1168
1169 searchexclude
1170 · Default: ""
1171
1172 · Type: String
1173
1174
1175 Space-separated options that limit the results from search.
1176
1177 searchopts
1178 · Default: ""
1179
1180 · Type: String
1181
1182
1183 Space-separated options that are always passed to search.
1184
1185 searchlimit
1186 · Default: 20
1187
1188 · Type: Number
1189
1190
1191 Number of items to limit search results to. Will not apply at all to
1192 legacy searches.
1193
1194 searchstaleness
1195 · Default: 900 (15 minutes)
1196
1197 · Type: Number
1198
1199
1200 The age of the cache, in seconds, before another registry request is
1201 made if using legacy search endpoint.
1202
1203 send-metrics
1204 · Default: false
1205
1206 · Type: Boolean
1207
1208
1209 If true, success/failure metrics will be reported to the registry
1210 stored in metrics-registry. These requests contain the number of suc‐
1211 cessful and failing runs of the npm CLI and the time period overwhich
1212 those counts were gathered. No identifying information is included in
1213 these requests.
1214
1215 shell
1216 · Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
1217 Windows
1218
1219 · Type: path
1220
1221
1222 The shell to run for the npm explore command.
1223
1224 shrinkwrap
1225 · Default: true
1226
1227 · Type: Boolean
1228
1229
1230 If set to false, then ignore npm-shrinkwrap.json files when installing.
1231 This will also prevent writing npm-shrinkwrap.json if save is true.
1232
1233 This option is an alias for --package-lock.
1234
1235 sign-git-commit
1236 · Default: false
1237
1238 · Type: Boolean
1239
1240
1241 If set to true, then the npm version command will commit the new pack‐
1242 age version using -S to add a signature.
1243
1244 Note that git requires you to have set up GPG keys in your git configs
1245 for this to work properly.
1246
1247 sign-git-tag
1248 · Default: false
1249
1250 · Type: Boolean
1251
1252
1253 If set to true, then the npm version command will tag the version using
1254 -s to add a signature.
1255
1256 Note that git requires you to have set up GPG keys in your git configs
1257 for this to work properly.
1258
1259 sso-poll-frequency
1260 · Default: 500
1261
1262 · Type: Number
1263
1264
1265 When used with SSO-enabled auth-types, configures how regularly the
1266 registry should be polled while the user is completing authentication.
1267
1268 sso-type
1269 · Default: 'oauth'
1270
1271 · Type: 'oauth', 'saml', or null
1272
1273
1274 If --auth-type=sso, the type of SSO type to use.
1275
1276 strict-ssl
1277 · Default: true
1278
1279 · Type: Boolean
1280
1281
1282 Whether or not to do SSL key validation when making requests to the
1283 registry via https.
1284
1285 See also the ca config.
1286
1287 tag
1288 · Default: latest
1289
1290 · Type: String
1291
1292
1293 If you ask npm to install a package and don't tell it a specific ver‐
1294 sion, then it will install the specified tag.
1295
1296 Also the tag that is added to the package@version specified by the npm
1297 tag command, if no explicit tag is given.
1298
1299 tag-version-prefix
1300 · Default: "v"
1301
1302 · Type: String
1303
1304
1305 If set, alters the prefix used when tagging a new version when perform‐
1306 ing a version increment using npm-version. To remove the prefix alto‐
1307 gether, set it to the empty string: "".
1308
1309 Because other tools may rely on the convention that npm version tags
1310 look like v1.0.0, only use this property if it is absolutely necessary.
1311 In particular, use care when overriding this setting for public pack‐
1312 ages.
1313
1314 timing
1315 · Default: false
1316
1317 · Type: Boolean
1318
1319
1320 If true, writes an npm-debug log to _logs and timing information to
1321 _timing.json, both in your cache. _timing.json is a newline delimited
1322 list of JSON objects. You can quickly view it with this json
1323 https://www.npmjs.com/package/json command line: json -g < ~/.npm/_tim‐
1324 ing.json.
1325
1326 tmp
1327 · Default: TMPDIR environment variable, or "/tmp"
1328
1329 · Type: path
1330
1331
1332 Where to store temporary files and folders. All temp files are deleted
1333 on success, but left behind on failure for forensic purposes.
1334
1335 unicode
1336 · Default: false on windows, true on mac/unix systems with a unicode
1337 locale
1338
1339 · Type: Boolean
1340
1341
1342 When set to true, npm uses unicode characters in the tree output. When
1343 false, it uses ascii characters to draw trees.
1344
1345 unsafe-perm
1346 · Default: false if running as root, true otherwise
1347
1348 · Type: Boolean
1349
1350
1351 Set to true to suppress the UID/GID switching when running package
1352 scripts. If set explicitly to false, then installing as a non-root
1353 user will fail.
1354
1355 update-notifier
1356 · Default: true
1357
1358 · Type: Boolean
1359
1360
1361 Set to false to suppress the update notification when using an older
1362 version of npm than the latest.
1363
1364 usage
1365 · Default: false
1366
1367 · Type: Boolean
1368
1369
1370 Set to show short usage output (like the -H output) instead of complete
1371 help when doing npm help npm-help.
1372
1373 user
1374 · Default: "nobody"
1375
1376 · Type: String or Number
1377
1378
1379 The UID to set to when running package scripts as root.
1380
1381 userconfig
1382 · Default: ~/.npmrc
1383
1384 · Type: path
1385
1386
1387 The location of user-level configuration settings.
1388
1389 umask
1390 · Default: 022
1391
1392 · Type: Octal numeric string in range 0000..0777 (0..511)
1393
1394
1395 The "umask" value to use when setting the file creation mode on files
1396 and folders.
1397
1398 Folders and executables are given a mode which is 0777 masked against
1399 this value. Other files are given a mode which is 0666 masked against
1400 this value. Thus, the defaults are 0755 and 0644 respectively.
1401
1402 user-agent
1403 · Default: node/{process.version} {process.platform} {process.arch}
1404
1405 · Type: String
1406
1407
1408 Sets a User-Agent to the request header
1409
1410 version
1411 · Default: false
1412
1413 · Type: boolean
1414
1415
1416 If true, output the npm version and exit successfully.
1417
1418 Only relevant when specified explicitly on the command line.
1419
1420 versions
1421 · Default: false
1422
1423 · Type: boolean
1424
1425
1426 If true, output the npm version as well as node's process.versions map,
1427 and exit successfully.
1428
1429 Only relevant when specified explicitly on the command line.
1430
1431 viewer
1432 · Default: "man" on Posix, "browser" on Windows
1433
1434 · Type: path
1435
1436
1437 The program to use to view help content.
1438
1439 Set to "browser" to view html help content in the default web browser.
1440
1442 · npm help config
1443
1444 · npm help 5 npmrc
1445
1446 · npm help 7 scripts
1447
1448 · npm help 5 folders
1449
1450 · npm help npm
1451
1452
1453
1454
1455
1456 October 2019 NPM-CONFIG(7)