codekingpro/portable-devtools
114k
1---
2title: Config
3section: 7
4description: About npm configuration
5---
6
7### Description
8
9This article details npm configuration in general.
10To learn about the `config` command, see [`npm config`](/commands/npm-config).
11
12npm gets its configuration values from the following sources, sorted by priority:
13
14#### Command Line Flags
15
16Putting `--foo bar` on the command line sets the `foo` configuration parameter to `"bar"`.
17A `--` argument tells the cli parser to stop reading flags.
18Using `--flag` without specifying any value will set the value to `true`.
19
20Example: `--flag1 --flag2` will set both configuration parameters to `true`, while `--flag1 --flag2 bar` will set `flag1` to `true`, and `flag2` to `bar`.
21Finally, `--flag1 --flag2 -- bar` will set both configuration parameters to `true`, and the `bar` is taken as a command argument.
22
23**Common examples:**
24
25* `npm install --prefix /path/to/dir` - Runs npm commands in a different directory without changing the current working directory
26* `npm install --global` - Installs packages globally (shorthand: `-g`)
27* `npm install --save-dev` - Saves to devDependencies (shorthand: `-D`)
28
29Any configuration option documented in the [Config Settings](#config-settings) section below can be set via command line flags using `--option-name value` syntax.
30
31#### Environment Variables
32
33Any environment variables that start with `npm_config_` will be interpreted as a configuration parameter.
34For example, putting `npm_config_foo=bar` in your environment will set the `foo` configuration parameter to `bar`.
35Any environment configurations that are not given a value will be given the value of `true`.
36Config values are case-insensitive, so `NPM_CONFIG_FOO=bar` will work the same.
37However, please note that inside [`scripts`](/using-npm/scripts) npm will set its own environment variables and Node will prefer those lowercase versions over any uppercase ones that you might set.
38For details see [this issue](https://github.com/npm/npm/issues/14528).
39
40Notice that you need to use underscores instead of dashes, so `--allow-same-version` would become `npm_config_allow_same_version=true`.
41
42**Important:** When defining custom configuration keys in `.npmrc` files, use hyphens instead of underscores (e.g., `custom-key=value`). This ensures they can be overridden by environment variables, since npm automatically converts underscores to hyphens when reading environment variables. Keys with underscores in `.npmrc` files cannot be overridden via environment variables.
43
44#### npmrc Files
45
46The four relevant files are:
47
48* per-project configuration file (`/path/to/my/project/.npmrc`)
49* per-user configuration file (defaults to `$HOME/.npmrc`; configurable via CLI option `--userconfig` or environment variable `$NPM_CONFIG_USERCONFIG`)
50* global configuration file (defaults to `$PREFIX/etc/npmrc`; configurable via CLI option `--globalconfig` or environment variable `$NPM_CONFIG_GLOBALCONFIG`)
51* npm's built-in configuration file (`/path/to/npm/npmrc`)
52
53See [npmrc](/configuring-npm/npmrc) for more details.
54
55#### Default Configs
56
57Run `npm config ls -l` to see a set of configuration parameters that are internal to npm, and are defaults if nothing else is specified.
58
59### Shorthands and Other CLI Niceties
60
61The following shorthands are parsed on the command-line:
62
63* `-a`: `--all`
64* `--enjoy-by`: `--before`
65* `-c`: `--call`
66* `--desc`: `--description`
67* `-f`: `--force`
68* `-g`: `--global`
69* `--iwr`: `--include-workspace-root`
70* `-L`: `--location`
71* `-d`: `--loglevel info`
72* `-s`: `--loglevel silent`
73* `--silent`: `--loglevel silent`
74* `--ddd`: `--loglevel silly`
75* `--dd`: `--loglevel verbose`
76* `--verbose`: `--loglevel verbose`
77* `-q`: `--loglevel warn`
78* `--quiet`: `--loglevel warn`
79* `-l`: `--long`
80* `-m`: `--message`
81* `--local`: `--no-global`
82* `-n`: `--no-yes`
83* `--no`: `--no-yes`
84* `-p`: `--parseable`
85* `--porcelain`: `--parseable`
86* `-C`: `--prefix`
87* `--readonly`: `--read-only`
88* `--reg`: `--registry`
89* `-S`: `--save`
90* `-B`: `--save-bundle`
91* `-D`: `--save-dev`
92* `-E`: `--save-exact`
93* `-O`: `--save-optional`
94* `-P`: `--save-prod`
95* `-?`: `--usage`
96* `-h`: `--usage`
97* `-H`: `--usage`
98* `--help`: `--usage`
99* `-v`: `--version`
100* `-w`: `--workspace`
101* `--ws`: `--workspaces`
102* `-y`: `--yes`
103
104If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter.
105For example:
106
107```bash
108npm ls --par
109# same as:
110npm ls --parseable
111```
112
113If multiple single-character shorthands are strung together, and the resulting combination is unambiguously not some other configuration param, then it is expanded to its various component pieces.
114For example:
115
116```bash
117npm ls -gpld
118# same as:
119npm ls --global --parseable --long --loglevel info
120```
121
122### Config Settings
123
124#### `_auth`
125
126* Default: null
127* Type: null or String
128
129A basic-auth string to use when authenticating against the npm registry.
130This will ONLY be used to authenticate against the npm registry. For other
131registries you will need to scope it like "//other-registry.tld/:_auth"
132
133Warning: This should generally not be set via a command-line option. It is
134safer to use a registry-provided authentication bearer token stored in the
135~/.npmrc file by running `npm login`.
136
137
138
139#### `access`
140
141* Default: 'public' for new packages, existing packages it will not change the
142 current level
143* Type: null, "restricted", or "public"
144
145If you do not want your scoped package to be publicly viewable (and
146installable) set `--access=restricted`.
147
148Unscoped packages cannot be set to `restricted`.
149
150Note: This defaults to not changing the current access level for existing
151packages. Specifying a value of `restricted` or `public` during publish will
152change the access for an existing package the same way that `npm access set
153status` would.
154
155
156
157#### `all`
158
159* Default: false
160* Type: Boolean
161
162When running `npm outdated` and `npm ls`, setting `--all` will show all
163outdated or installed packages, rather than only those directly depended
164upon by the current project.
165
166
167
168#### `allow-git`
169
170* Default: "all"
171* Type: "all", "none", or "root"
172
173Limits the ability for npm to fetch dependencies from git references. That
174is, dependencies that point to a git repo instead of a version or semver
175range. Please note that this could leave your tree incomplete and some
176packages may not function as intended or designed.
177
178`all` allows any git dependencies to be fetched and installed. `none`
179prevents any git dependencies from being fetched and installed. `root` only
180allows git dependencies defined in your project's package.json to be fetched
181installed. Also allows git dependencies to be fetched for other commands
182like `npm view`
183
184
185
186#### `allow-same-version`
187
188* Default: false
189* Type: Boolean
190
191Prevents throwing an error when `npm version` is used to set the new version
192to the same value as the current version.
193
194
195
196#### `audit`
197
198* Default: true
199* Type: Boolean
200
201When "true" submit audit reports alongside the current npm command to the
202default registry and all registries configured for scopes. See the
203documentation for [`npm audit`](/commands/npm-audit) for details on what is
204submitted.
205
206
207
208#### `audit-level`
209
210* Default: null
211* Type: null, "info", "low", "moderate", "high", "critical", or "none"
212
213The minimum level of vulnerability for `npm audit` to exit with a non-zero
214exit code.
215
216
217
218#### `auth-type`
219
220* Default: "web"
221* Type: "legacy" or "web"
222
223What authentication strategy to use with `login`. Note that if an `otp`
224config is given, this value will always be set to `legacy`.
225
226
227
228#### `before`
229
230* Default: null
231* Type: null or Date
232
233If passed to `npm install`, will rebuild the npm tree such that only
234versions that were available **on or before** the given date are installed.
235If there are no versions available for the current set of dependencies, the
236command will error.
237
238If the requested version is a `dist-tag` and the given tag does not pass the
239`--before` filter, the most recent version less than or equal to that tag
240will be used. For example, `foo@latest` might install `foo@1.2` even though
241`latest` is `2.0`.
242
243This config cannot be used with: `min-release-age`
244
245#### `bin-links`
246
247* Default: true
248* Type: Boolean
249
250Tells npm to create symlinks (or `.cmd` shims on Windows) for package
251executables.
252
253Set to false to have it not do this. This can be used to work around the
254fact that some file systems don't support symlinks, even on ostensibly Unix
255systems.
256
257
258
259#### `browser`
260
261* Default: macOS: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
262* Type: null, Boolean, or String
263
264The browser that is called by npm commands to open websites.
265
266Set to `false` to suppress browser behavior and instead print urls to
267terminal.
268
269Set to `true` to use default system URL opener.
270
271
272
273#### `bypass-2fa`
274
275* Default: false
276* Type: Boolean
277
278When creating a Granular Access Token with `npm token create`, setting this
279to true will allow the token to bypass two-factor authentication. This is
280useful for automation and CI/CD workflows.
281
282
283
284#### `ca`
285
286* Default: null
287* Type: null or String (can be set multiple times)
288
289The Certificate Authority signing certificate that is trusted for SSL
290connections to the registry. Values should be in PEM format (Windows calls
291it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string
292"\n". For example:
293
294```ini
295ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
296```
297
298Set to `null` to only allow "known" registrars, or to a specific CA cert to
299trust only that specific signing authority.
300
301Multiple CAs can be trusted by specifying an array of certificates:
302
303```ini
304ca[]="..."
305ca[]="..."
306```
307
308See also the `strict-ssl` config.
309
310
311
312#### `cache`
313
314* Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm`
315* Type: Path
316
317The location of npm's cache directory.
318
319
320
321#### `cafile`
322
323* Default: null
324* Type: Path
325
326A path to a file containing one or multiple Certificate Authority signing
327certificates. Similar to the `ca` setting, but allows for multiple CA's, as
328well as for the CA information to be stored in a file on disk.
329
330
331
332#### `call`
333
334* Default: ""
335* Type: String
336
337Optional companion option for `npm exec`, `npx` that allows for specifying a
338custom command to be run along with the installed packages.
339
340```bash
341npm exec --package yo --package generator-node --call "yo node"
342```
343
344
345
346#### `cidr`
347
348* Default: null
349* Type: null or String (can be set multiple times)
350
351This is a list of CIDR address to be used when configuring limited access
352tokens with the `npm token create` command.
353
354
355
356#### `color`
357
358* Default: true unless the NO_COLOR environ is set to something other than '0'
359* Type: "always" or Boolean
360
361If false, never shows colors. If `"always"` then always shows colors. If
362true, then only prints color codes for tty file descriptors.
363
364
365
366#### `commit-hooks`
367
368* Default: true
369* Type: Boolean
370
371Run git commit hooks when using the `npm version` command.
372
373
374
375#### `cpu`
376
377* Default: null
378* Type: null or String
379
380Override CPU architecture of native modules to install. Acceptable values
381are same as `cpu` field of package.json, which comes from `process.arch`.
382
383
384
385#### `depth`
386
387* Default: `Infinity` if `--all` is set; otherwise, `0`
388* Type: null or Number
389
390The depth to go when recursing packages for `npm ls`.
391
392If not set, `npm ls` will show only the immediate dependencies of the root
393project. If `--all` is set, then npm will show all dependencies by default.
394
395
396
397#### `description`
398
399* Default: true
400* Type: Boolean
401
402Show the description in `npm search`
403
404
405
406#### `diff`
407
408* Default:
409* Type: String (can be set multiple times)
410
411Define arguments to compare in `npm diff`.
412
413
414
415#### `diff-dst-prefix`
416
417* Default: "b/"
418* Type: String
419
420Destination prefix to be used in `npm diff` output.
421
422
423
424#### `diff-ignore-all-space`
425
426* Default: false
427* Type: Boolean
428
429Ignore whitespace when comparing lines in `npm diff`.
430
431
432
433#### `diff-name-only`
434
435* Default: false
436* Type: Boolean
437
438Prints only filenames when using `npm diff`.
439
440
441
442#### `diff-no-prefix`
443
444* Default: false
445* Type: Boolean
446
447Do not show any source or destination prefix in `npm diff` output.
448
449Note: this causes `npm diff` to ignore the `--diff-src-prefix` and
450`--diff-dst-prefix` configs.
451
452
453
454#### `diff-src-prefix`
455
456* Default: "a/"
457* Type: String
458
459Source prefix to be used in `npm diff` output.
460
461
462
463#### `diff-text`
464
465* Default: false
466* Type: Boolean
467
468Treat all files as text in `npm diff`.
469
470
471
472#### `diff-unified`
473
474* Default: 3
475* Type: Number
476
477The number of lines of context to print in `npm diff`.
478
479
480
481#### `dry-run`
482
483* Default: false
484* Type: Boolean
485
486Indicates that you don't want npm to make any changes and that it should
487only report what it would have done. This can be passed into any of the
488commands that modify your local installation, eg, `install`, `update`,
489`dedupe`, `uninstall`, as well as `pack` and `publish`.
490
491Note: This is NOT honored by other network related commands, eg `dist-tags`,
492`owner`, etc.
493
494
495
496#### `editor`
497
498* Default: The EDITOR or VISUAL environment variables, or
499 '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
500* Type: String
501
502The command to run for `npm edit` and `npm config edit`.
503
504
505
506#### `engine-strict`
507
508* Default: false
509* Type: Boolean
510
511If set to true, then npm will stubbornly refuse to install (or even consider
512installing) any package that claims to not be compatible with the current
513Node.js version.
514
515This can be overridden by setting the `--force` flag.
516
517
518
519#### `expect-result-count`
520
521* Default: null
522* Type: null or Number
523
524Tells to expect a specific number of results from the command.
525
526This config cannot be used with: `expect-results`
527
528#### `expect-results`
529
530* Default: null
531* Type: null or Boolean
532
533Tells npm whether or not to expect results from the command. Can be either
534true (expect some results) or false (expect no results).
535
536This config cannot be used with: `expect-result-count`
537
538#### `expires`
539
540* Default: null
541* Type: null or Number
542
543When creating a Granular Access Token with `npm token create`, this sets the
544expiration in days. If not specified, the server will determine the default
545expiration.
546
547
548
549#### `fetch-retries`
550
551* Default: 2
552* Type: Number
553
554The "retries" config for the `retry` module to use when fetching packages
555from the registry.
556
557npm will retry idempotent read requests to the registry in the case of
558network failures or 5xx HTTP errors.
559
560
561
562#### `fetch-retry-factor`
563
564* Default: 10
565* Type: Number
566
567The "factor" config for the `retry` module to use when fetching packages.
568
569
570
571#### `fetch-retry-maxtimeout`
572
573* Default: 60000 (1 minute)
574* Type: Number
575
576The "maxTimeout" config for the `retry` module to use when fetching
577packages.
578
579
580
581#### `fetch-retry-mintimeout`
582
583* Default: 10000 (10 seconds)
584* Type: Number
585
586The "minTimeout" config for the `retry` module to use when fetching
587packages.
588
589
590
591#### `fetch-timeout`
592
593* Default: 300000 (5 minutes)
594* Type: Number
595
596The maximum amount of time to wait for HTTP requests to complete.
597
598
599
600#### `force`
601
602* Default: false
603* Type: Boolean
604
605Removes various protections against unfortunate side effects, common
606mistakes, unnecessary performance degradation, and malicious input.
607
608* Allow clobbering non-npm files in global installs.
609* Allow the `npm version` command to work on an unclean git repository.
610* Allow deleting the cache folder with `npm cache clean`.
611* Allow installing packages that have an `engines` declaration requiring a
612 different version of npm.
613* Allow installing packages that have an `engines` declaration requiring a
614 different version of `node`, even if `--engine-strict` is enabled.
615* Allow `npm audit fix` to install modules outside your stated dependency
616 range (including SemVer-major changes).
617* Allow unpublishing all versions of a published package.
618* Allow conflicting peerDependencies to be installed in the root project.
619* Implicitly set `--yes` during `npm init`.
620* Allow clobbering existing values in `npm pkg`
621* Allow unpublishing of entire packages (not just a single version).
622
623If you don't have a clear idea of what you want to do, it is strongly
624recommended that you do not use this option!
625
626
627
628#### `foreground-scripts`
629
630* Default: `false` unless when using `npm pack` or `npm publish` where it
631 defaults to `true`
632* Type: Boolean
633
634Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
635scripts for installed packages in the foreground process, sharing standard
636input, output, and error with the main npm process.
637
638Note that this will generally make installs run slower, and be much noisier,
639but can be useful for debugging.
640
641
642
643#### `format-package-lock`
644
645* Default: true
646* Type: Boolean
647
648Format `package-lock.json` or `npm-shrinkwrap.json` as a human readable
649file.
650
651
652
653#### `fund`
654
655* Default: true
656* Type: Boolean
657
658When "true" displays the message at the end of each `npm install`
659acknowledging the number of dependencies looking for funding. See [`npm
660fund`](/commands/npm-fund) for details.
661
662
663
664#### `git`
665
666* Default: "git"
667* Type: String
668
669The command to use for git commands. If git is installed on the computer,
670but is not in the `PATH`, then set this to the full path to the git binary.
671
672
673
674#### `git-tag-version`
675
676* Default: true
677* Type: Boolean
678
679Tag the commit when using the `npm version` command. Setting this to false
680results in no commit being made at all.
681
682
683
684#### `global`
685
686* Default: false
687* Type: Boolean
688
689Operates in "global" mode, so that packages are installed into the `prefix`
690folder instead of the current working directory. See
691[folders](/configuring-npm/folders) for more on the differences in behavior.
692
693* packages are installed into the `{prefix}/lib/node_modules` folder, instead
694 of the current working directory.
695* bin files are linked to `{prefix}/bin`
696* man pages are linked to `{prefix}/share/man`
697
698
699
700#### `globalconfig`
701
702* Default: The global --prefix setting plus 'etc/npmrc'. For example,
703 '/usr/local/etc/npmrc'
704* Type: Path
705
706The config file to read for global config options.
707
708
709
710#### `heading`
711
712* Default: "npm"
713* Type: String
714
715The string that starts all the debugging log output.
716
717
718
719#### `https-proxy`
720
721* Default: null
722* Type: null or URL
723
724A proxy to use for outgoing https requests. If the `HTTPS_PROXY` or
725`https_proxy` or `HTTP_PROXY` or `http_proxy` environment variables are set,
726proxy settings will be honored by the underlying `make-fetch-happen`
727library.
728
729
730
731#### `if-present`
732
733* Default: false
734* Type: Boolean
735
736If true, npm will not exit with an error code when `run` is invoked for a
737script that isn't defined in the `scripts` section of `package.json`. This
738option can be used when it's desirable to optionally run a script when it's
739present and fail if the script fails. This is useful, for example, when
740running scripts that may only apply for some builds in an otherwise generic
741CI setup.
742
743This value is not exported to the environment for child processes.
744
745#### `ignore-scripts`
746
747* Default: false
748* Type: Boolean
749
750If true, npm does not run scripts specified in package.json files.
751
752Note that commands explicitly intended to run a particular script, such as
753`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
754run their intended script if `ignore-scripts` is set, but they will *not*
755run any pre- or post-scripts.
756
757
758
759#### `include`
760
761* Default:
762* Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
763
764Option that allows for defining which types of dependencies to install.
765
766This is the inverse of `--omit=<type>`.
767
768Dependency types specified in `--include` will not be omitted, regardless of
769the order in which omit/include are specified on the command-line.
770
771
772
773#### `include-attestations`
774
775* Default: false
776* Type: Boolean
777
778When used with `npm audit signatures --json`, includes the full sigstore
779attestation bundles in the JSON output for each verified package. The
780bundles contain DSSE envelopes, verification material, and transparency log
781entries.
782
783
784
785#### `include-staged`
786
787* Default: false
788* Type: Boolean
789
790Allow installing "staged" published packages, as defined by [npm RFC PR
791#92](https://github.com/npm/rfcs/pull/92).
792
793This is experimental, and not implemented by the npm public registry.
794
795
796
797#### `include-workspace-root`
798
799* Default: false
800* Type: Boolean
801
802Include the workspace root when workspaces are enabled for a command.
803
804When false, specifying individual workspaces via the `workspace` config, or
805all workspaces via the `workspaces` flag, will cause npm to operate only on
806the specified workspaces, and not on the root project.
807
808This value is not exported to the environment for child processes.
809
810#### `init-author-email`
811
812* Default: ""
813* Type: String
814
815The value `npm init` should use by default for the package author's email.
816
817
818
819#### `init-author-name`
820
821* Default: ""
822* Type: String
823
824The value `npm init` should use by default for the package author's name.
825
826
827
828#### `init-author-url`
829
830* Default: ""
831* Type: "" or URL
832
833The value `npm init` should use by default for the package author's
834homepage.
835
836
837
838#### `init-license`
839
840* Default: "ISC"
841* Type: String
842
843The value `npm init` should use by default for the package license.
844
845
846
847#### `init-module`
848
849* Default: "~/.npm-init.js"
850* Type: Path
851
852A module that will be loaded by the `npm init` command. See the
853documentation for the
854[init-package-json](https://github.com/npm/init-package-json) module for
855more information, or [npm init](/commands/npm-init).
856
857
858
859#### `init-private`
860
861* Default: false
862* Type: Boolean
863
864The value `npm init` should use by default for the package's private flag.
865
866
867
868#### `init-type`
869
870* Default: "commonjs"
871* Type: String
872
873The value that `npm init` should use by default for the package.json type
874field.
875
876
877
878#### `init-version`
879
880* Default: "1.0.0"
881* Type: SemVer string
882
883The value that `npm init` should use by default for the package version
884number, if not already set in package.json.
885
886
887
888#### `install-links`
889
890* Default: false
891* Type: Boolean
892
893When set file: protocol dependencies will be packed and installed as regular
894dependencies instead of creating a symlink. This option has no effect on
895workspaces.
896
897
898
899#### `install-strategy`
900
901* Default: "hoisted"
902* Type: "hoisted", "nested", "shallow", or "linked"
903
904Sets the strategy for installing packages in node_modules. hoisted
905(default): Install non-duplicated in top-level, and duplicated as necessary
906within directory structure. nested: (formerly --legacy-bundling) install in
907place, no hoisting. shallow (formerly --global-style) only install direct
908deps at top-level. linked: (experimental) install in node_modules/.store,
909link in place, unhoisted.
910
911
912
913#### `json`
914
915* Default: false
916* Type: Boolean
917
918Whether or not to output JSON data, rather than the normal output.
919
920* In `npm pkg set` it enables parsing set values with JSON.parse() before
921 saving them to your `package.json`.
922
923Not supported by all npm commands.
924
925
926
927#### `legacy-peer-deps`
928
929* Default: false
930* Type: Boolean
931
932Causes npm to completely ignore `peerDependencies` when building a package
933tree, as in npm versions 3 through 6.
934
935If a package cannot be installed because of overly strict `peerDependencies`
936that collide, it provides a way to move forward resolving the situation.
937
938This differs from `--omit=peer`, in that `--omit=peer` will avoid unpacking
939`peerDependencies` on disk, but will still design a tree such that
940`peerDependencies` _could_ be unpacked in a correct place.
941
942Use of `legacy-peer-deps` is not recommended, as it will not enforce the
943`peerDependencies` contract that meta-dependencies may rely on.
944
945
946
947#### `libc`
948
949* Default: null
950* Type: null or String
951
952Override libc of native modules to install. Acceptable values are same as
953`libc` field of package.json
954
955
956
957#### `link`
958
959* Default: false
960* Type: Boolean
961
962Used with `npm ls`, limiting output to only those packages that are linked.
963
964
965
966#### `local-address`
967
968* Default: null
969* Type: IP Address
970
971The IP address of the local interface to use when making connections to the
972npm registry. Must be IPv4 in versions of Node prior to 0.12.
973
974
975
976#### `location`
977
978* Default: "user" unless `--global` is passed, which will also set this value
979 to "global"
980* Type: "global", "user", or "project"
981
982When passed to `npm config` this refers to which config file to use.
983
984When set to "global" mode, packages are installed into the `prefix` folder
985instead of the current working directory. See
986[folders](/configuring-npm/folders) for more on the differences in behavior.
987
988* packages are installed into the `{prefix}/lib/node_modules` folder, instead
989 of the current working directory.
990* bin files are linked to `{prefix}/bin`
991* man pages are linked to `{prefix}/share/man`
992
993
994
995#### `lockfile-version`
996
997* Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3;
998 otherwise, maintain current lockfile version.
999* Type: null, 1, 2, 3, "1", "2", or "3"
1000
1001Set the lockfile format version to be used in package-lock.json and
1002npm-shrinkwrap-json files. Possible options are:
1003
10041: The lockfile version used by npm versions 5 and 6. Lacks some data that
1005is used during the install, resulting in slower and possibly less
1006deterministic installs. Prevents lockfile churn when interoperating with
1007older npm versions.
1008
10092: The default lockfile version used by npm version 7 and 8. Includes both
1010the version 1 lockfile data and version 3 lockfile data, for maximum
1011determinism and interoperability, at the expense of more bytes on disk.
1012
10133: Only the new lockfile information introduced in npm version 7. Smaller on
1014disk than lockfile version 2, but not interoperable with older npm versions.
1015Ideal if all users are on npm version 7 and higher.
1016
1017
1018
1019#### `loglevel`
1020
1021* Default: "notice"
1022* Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or
1023 "silly"
1024
1025What level of logs to report. All logs are written to a debug log, with the
1026path to that file printed if the execution of a command fails.
1027
1028Any logs of a higher level than the setting are shown. The default is
1029"notice".
1030
1031See also the `foreground-scripts` config.
1032
1033
1034
1035#### `logs-dir`
1036
1037* Default: A directory named `_logs` inside the cache
1038* Type: null or Path
1039
1040The location of npm's log directory. See [`npm logging`](/using-npm/logging)
1041for more information.
1042
1043
1044
1045#### `logs-max`
1046
1047* Default: 10
1048* Type: Number
1049
1050The maximum number of log files to store.
1051
1052If set to 0, no log files will be written for the current run.
1053
1054
1055
1056#### `long`
1057
1058* Default: false
1059* Type: Boolean
1060
1061Show extended information in `ls`, `search`, and `help-search`.
1062
1063
1064
1065#### `maxsockets`
1066
1067* Default: 15
1068* Type: Number
1069
1070The maximum number of connections to use per origin (protocol/host/port
1071combination).
1072
1073
1074
1075#### `message`
1076
1077* Default: "%s"
1078* Type: String
1079
1080Commit message which is used by `npm version` when creating version commit.
1081
1082Any "%s" in the message will be replaced with the version number.
1083
1084
1085
1086#### `min-release-age`
1087
1088* Default: null
1089* Type: null or Number
1090
1091If set, npm will build the npm tree such that only versions that were
1092available more than the given number of days ago will be installed. If there
1093are no versions available for the current set of dependencies, the command
1094will error.
1095
1096This flag is a complement to `before`, which accepts an exact date instead
1097of a relative number of days.
1098
1099This config cannot be used with: `before`
1100
1101This value is not exported to the environment for child processes.
1102
1103#### `name`
1104
1105* Default: null
1106* Type: null or String
1107
1108When creating a Granular Access Token with `npm token create`, this sets the
1109name/description for the token.
1110
1111
1112
1113#### `node-gyp`
1114
1115* Default: The path to the node-gyp bin that ships with npm
1116* Type: Path
1117
1118This is the location of the "node-gyp" bin. By default it uses one that
1119ships with npm itself.
1120
1121You can use this config to specify your own "node-gyp" to run when it is
1122required to build a package.
1123
1124
1125
1126#### `node-options`
1127
1128* Default: null
1129* Type: null or String
1130
1131Options to pass through to Node.js via the `NODE_OPTIONS` environment
1132variable. This does not impact how npm itself is executed but it does impact
1133how lifecycle scripts are called.
1134
1135
1136
1137#### `noproxy`
1138
1139* Default: The value of the NO_PROXY environment variable
1140* Type: String (can be set multiple times)
1141
1142Domain extensions that should bypass any proxies.
1143
1144Also accepts a comma-delimited string.
1145
1146
1147
1148#### `offline`
1149
1150* Default: false
1151* Type: Boolean
1152
1153Force offline mode: no network requests will be done during install. To
1154allow the CLI to fill in missing cache data, see `--prefer-offline`.
1155
1156
1157
1158#### `omit`
1159
1160* Default: 'dev' if the `NODE_ENV` environment variable is set to
1161 'production'; otherwise, empty.
1162* Type: "dev", "optional", or "peer" (can be set multiple times)
1163
1164Dependency types to omit from the installation tree on disk.
1165
1166Note that these dependencies _are_ still resolved and added to the
1167`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
1168physically installed on disk.
1169
1170If a package type appears in both the `--include` and `--omit` lists, then
1171it will be included.
1172
1173If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
1174variable will be set to `'production'` for all lifecycle scripts.
1175
1176
1177
1178#### `omit-lockfile-registry-resolved`
1179
1180* Default: false
1181* Type: Boolean
1182
1183This option causes npm to create lock files without a `resolved` key for
1184registry dependencies. Subsequent installs will need to resolve tarball
1185endpoints with the configured registry, likely resulting in a longer install
1186time.
1187
1188
1189
1190#### `orgs`
1191
1192* Default: null
1193* Type: null or String (can be set multiple times)
1194
1195When creating a Granular Access Token with `npm token create`, this limits
1196the token access to specific organizations.
1197
1198
1199
1200#### `orgs-permission`
