1 ---
2 title: Config
3 section: 7
4 description: About npm configuration
5 github_repo: npm/cli
6 github_branch: latest
7 github_path: docs/lib/content/using-npm/config.md
8 redirect_from:
9 - /cli-documentation/misc/config
10 - /cli-documentation/using-npm/config
11 - /cli-documentation/v11/misc/config
12 - /cli-documentation/v11/using-npm/config
13 - /cli/misc/config
14 - /cli/using-npm/config
15 - /cli/v11/misc/config
16 - /misc/config
17 - /using-npm/config
18 ---
19
20 ### Description
21
22 This article details npm configuration in general. To learn about the `config` command, see [`npm config`](/cli/v11/commands/npm-config).
23
24 npm gets its configuration values from the following sources, sorted by priority:
25
26 #### Command Line Flags
27
28 Putting `--foo bar` on the command line sets the `foo` configuration parameter to `"bar"`. A `--` argument tells the cli parser to stop reading flags. Using `--flag` without specifying any value will set the value to `true`.
29
30 Example: `--flag1 --flag2` will set both configuration parameters to `true`, while `--flag1 --flag2 bar` will set `flag1` to `true`, and `flag2` to `bar`. Finally, `--flag1 --flag2 -- bar` will set both configuration parameters to `true`, and the `bar` is taken as a command argument.
31
32 **Common examples:**
33
34 - `npm install --prefix /path/to/dir` - Runs npm commands in a different directory without changing the current working directory
35 - `npm install --global` - Installs packages globally (shorthand: `-g`)
36 - `npm install --save-dev` - Saves to devDependencies (shorthand: `-D`)
37
38 Any configuration option documented in the [Config Settings](#config-settings) section below can be set via command line flags using `--option-name value` syntax.
39
40 #### Environment Variables
41
42 Any environment variables that start with `npm_config_` will be interpreted as a configuration parameter. For example, putting `npm_config_foo=bar` in your environment will set the `foo` configuration parameter to `bar`. Any environment configurations that are not given a value will be given the value of `true`. Config values are case-insensitive, so `NPM_CONFIG_FOO=bar` will work the same. However, please note that inside [`scripts`](/cli/v11/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. For details see [this issue](https://github.com/npm/npm/issues/14528).
43
44 Notice that you need to use underscores instead of dashes, so `--allow-same-version` would become `npm_config_allow_same_version=true`.
45
46 **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.
47
48 #### npmrc Files
49
50 The four relevant files are:
51
52 - per-project configuration file (`/path/to/my/project/.npmrc`)
53 - per-user configuration file (defaults to `$HOME/.npmrc`; configurable via CLI option `--userconfig` or environment variable `$NPM_CONFIG_USERCONFIG`)
54 - global configuration file (defaults to `$PREFIX/etc/npmrc`; configurable via CLI option `--globalconfig` or environment variable `$NPM_CONFIG_GLOBALCONFIG`)
55 - npm's built-in configuration file (`/path/to/npm/npmrc`)
56
57 See [npmrc](/cli/v11/configuring-npm/npmrc) for more details.
58
59 #### Default Configs
60
61 Run `npm config ls -l` to see a set of configuration parameters that are internal to npm, and are defaults if nothing else is specified.
62
63 ### Shorthands and Other CLI Niceties
64
65 The following shorthands are parsed on the command-line:
66
67 - `-a`: `--all`
68 - `--enjoy-by`: `--before`
69 - `-c`: `--call`
70 - `--desc`: `--description`
71 - `-f`: `--force`
72 - `-g`: `--global`
73 - `--iwr`: `--include-workspace-root`
74 - `-L`: `--location`
75 - `-d`: `--loglevel info`
76 - `-s`: `--loglevel silent`
77 - `--silent`: `--loglevel silent`
78 - `--ddd`: `--loglevel silly`
79 - `--dd`: `--loglevel verbose`
80 - `--verbose`: `--loglevel verbose`
81 - `-q`: `--loglevel warn`
82 - `--quiet`: `--loglevel warn`
83 - `-l`: `--long`
84 - `-m`: `--message`
85 - `--local`: `--no-global`
86 - `-n`: `--no-yes`
87 - `--no`: `--no-yes`
88 - `-p`: `--parseable`
89 - `--porcelain`: `--parseable`
90 - `-C`: `--prefix`
91 - `--readonly`: `--read-only`
92 - `--reg`: `--registry`
93 - `-S`: `--save`
94 - `-B`: `--save-bundle`
95 - `-D`: `--save-dev`
96 - `-E`: `--save-exact`
97 - `-O`: `--save-optional`
98 - `-P`: `--save-prod`
99 - `-?`: `--usage`
100 - `-h`: `--usage`
101 - `-H`: `--usage`
102 - `--help`: `--usage`
103 - `-v`: `--version`
104 - `-w`: `--workspace`
105 - `--ws`: `--workspaces`
106 - `-y`: `--yes`
107
108 If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter. For example:
109
110 ```bash
111 npm ls --par
112 # same as:
113 npm ls --parseable
114 ```
115
116 If 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. For example:
117
118 ```bash
119 npm ls -gpld
120 # same as:
121 npm ls --global --parseable --long --loglevel info
122 ```
123
124 ### Config Settings
125
126 #### `_auth`
127
128 - Default: null
129 - Type: null or String
130
131 A basic-auth string to use when authenticating against the npm registry. This will ONLY be used to authenticate against the npm registry. For other registries you will need to scope it like "//other-registry.tld/:\_auth"
132
133 Warning: This should generally not be set via a command-line option. It is safer to use a registry-provided authentication bearer token stored in the ~/.npmrc file by running `npm login`.
134
135 #### `access`
136
137 - Default: 'public' for new packages, existing packages it will not change the current level
138 - Type: null, "restricted", or "public"
139
140 If you do not want your scoped package to be publicly viewable (and installable) set `--access=restricted`.
141
142 Unscoped packages cannot be set to `restricted`.
143
144 Note: This defaults to not changing the current access level for existing packages. Specifying a value of `restricted` or `public` during publish will change the access for an existing package the same way that `npm access set status` would.
145
146 #### `all`
147
148 - Default: false
149 - Type: Boolean
150
151 When running `npm outdated` and `npm ls`, setting `--all` will show all outdated or installed packages, rather than only those directly depended upon by the current project.
152
153 #### `allow-git`
154
155 - Default: "all"
156 - Type: "all", "none", or "root"
157
158 Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed.
159
160 `all` allows any git dependencies to be fetched and installed. `none` prevents any git dependencies from being fetched and installed. `root` only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like `npm view`
161
162 #### `allow-same-version`
163
164 - Default: false
165 - Type: Boolean
166
167 Prevents throwing an error when `npm version` is used to set the new version to the same value as the current version.
168
169 #### `audit`
170
171 - Default: true
172 - Type: Boolean
173
174 When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v11/commands/npm-audit) for details on what is submitted.
175
176 #### `audit-level`
177
178 - Default: null
179 - Type: null, "info", "low", "moderate", "high", "critical", or "none"
180
181 The minimum level of vulnerability for `npm audit` to exit with a non-zero exit code.
182
183 #### `auth-type`
184
185 - Default: "web"
186 - Type: "legacy" or "web"
187
188 What authentication strategy to use with `login`. Note that if an `otp` config is given, this value will always be set to `legacy`.
189
190 #### `before`
191
192 - Default: null
193 - Type: null or Date
194
195 If passed to `npm install`, will rebuild the npm tree such that only versions that were available **on or before** the given date are installed. If there are no versions available for the current set of dependencies, the command will error.
196
197 If the requested version is a `dist-tag` and the given tag does not pass the `--before` filter, the most recent version less than or equal to that tag will be used. For example, `foo@latest` might install `foo@1.2` even though `latest` is `2.0`.
198
199 This config cannot be used with: `min-release-age`
200
201 #### `bin-links`
202
203 - Default: true
204 - Type: Boolean
205
206 Tells npm to create symlinks (or `.cmd` shims on Windows) for package executables.
207
208 Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems.
209
210 #### `browser`
211
212 - Default: macOS: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
213 - Type: null, Boolean, or String
214
215 The browser that is called by npm commands to open websites.
216
217 Set to `false` to suppress browser behavior and instead print urls to terminal.
218
219 Set to `true` to use default system URL opener.
220
221 #### `bypass-2fa`
222
223 - Default: false
224 - Type: Boolean
225
226 When creating a Granular Access Token with `npm token create`, setting this to true will allow the token to bypass two-factor authentication. This is useful for automation and CI/CD workflows.
227
228 #### `ca`
229
230 - Default: null
231 - Type: null or String (can be set multiple times)
232
233 The Certificate Authority signing certificate that is trusted for SSL connections to the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\n". For example:
234
235 ```ini
236 ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
237 ```
238
239 Set to `null` to only allow "known" registrars, or to a specific CA cert to trust only that specific signing authority.
240
241 Multiple CAs can be trusted by specifying an array of certificates:
242
243 ```ini
244 ca[]="..."
245 ca[]="..."
246 ```
247
248 See also the `strict-ssl` config.
249
250 #### `cache`
251
252 - Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm`
253 - Type: Path
254
255 The location of npm's cache directory.
256
257 #### `cafile`
258
259 - Default: null
260 - Type: Path
261
262 A path to a file containing one or multiple Certificate Authority signing certificates. Similar to the `ca` setting, but allows for multiple CA's, as well as for the CA information to be stored in a file on disk.
263
264 #### `call`
265
266 - Default: ""
267 - Type: String
268
269 Optional companion option for `npm exec`, `npx` that allows for specifying a custom command to be run along with the installed packages.
270
271 ```bash
272 npm exec --package yo --package generator-node --call "yo node"
273 ```
274
275 #### `cidr`
276
277 - Default: null
278 - Type: null or String (can be set multiple times)
279
280 This is a list of CIDR address to be used when configuring limited access tokens with the `npm token create` command.
281
282 #### `color`
283
284 - Default: true unless the NO_COLOR environ is set to something other than '0'
285 - Type: "always" or Boolean
286
287 If false, never shows colors. If `"always"` then always shows colors. If true, then only prints color codes for tty file descriptors.
288
289 #### `commit-hooks`
290
291 - Default: true
292 - Type: Boolean
293
294 Run git commit hooks when using the `npm version` command.
295
296 #### `cpu`
297
298 - Default: null
299 - Type: null or String
300
301 Override CPU architecture of native modules to install. Acceptable values are same as `cpu` field of package.json, which comes from `process.arch`.
302
303 #### `depth`
304
305 - Default: `Infinity` if `--all` is set; otherwise, `0`
306 - Type: null or Number
307
308 The depth to go when recursing packages for `npm ls`.
309
310 If not set, `npm ls` will show only the immediate dependencies of the root project. If `--all` is set, then npm will show all dependencies by default.
311
312 #### `description`
313
314 - Default: true
315 - Type: Boolean
316
317 Show the description in `npm search`
318
319 #### `diff`
320
321 - Default:
322 - Type: String (can be set multiple times)
323
324 Define arguments to compare in `npm diff`.
325
326 #### `diff-dst-prefix`
327
328 - Default: "b/"
329 - Type: String
330
331 Destination prefix to be used in `npm diff` output.
332
333 #### `diff-ignore-all-space`
334
335 - Default: false
336 - Type: Boolean
337
338 Ignore whitespace when comparing lines in `npm diff`.
339
340 #### `diff-name-only`
341
342 - Default: false
343 - Type: Boolean
344
345 Prints only filenames when using `npm diff`.
346
347 #### `diff-no-prefix`
348
349 - Default: false
350 - Type: Boolean
351
352 Do not show any source or destination prefix in `npm diff` output.
353
354 Note: this causes `npm diff` to ignore the `--diff-src-prefix` and `--diff-dst-prefix` configs.
355
356 #### `diff-src-prefix`
357
358 - Default: "a/"
359 - Type: String
360
361 Source prefix to be used in `npm diff` output.
362
363 #### `diff-text`
364
365 - Default: false
366 - Type: Boolean
367
368 Treat all files as text in `npm diff`.
369
370 #### `diff-unified`
371
372 - Default: 3
373 - Type: Number
374
375 The number of lines of context to print in `npm diff`.
376
377 #### `dry-run`
378
379 - Default: false
380 - Type: Boolean
381
382 Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, `install`, `update`, `dedupe`, `uninstall`, as well as `pack` and `publish`.
383
384 Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc.
385
386 #### `editor`
387
388 - Default: The EDITOR or VISUAL environment variables, or '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
389 - Type: String
390
391 The command to run for `npm edit` and `npm config edit`.
392
393 #### `engine-strict`
394
395 - Default: false
396 - Type: Boolean
397
398 If set to true, then npm will stubbornly refuse to install (or even consider installing) any package that claims to not be compatible with the current Node.js version.
399
400 This can be overridden by setting the `--force` flag.
401
402 #### `expect-result-count`
403
404 - Default: null
405 - Type: null or Number
406
407 Tells to expect a specific number of results from the command.
408
409 This config cannot be used with: `expect-results`
410
411 #### `expect-results`
412
413 - Default: null
414 - Type: null or Boolean
415
416 Tells npm whether or not to expect results from the command. Can be either true (expect some results) or false (expect no results).
417
418 This config cannot be used with: `expect-result-count`
419
420 #### `expires`
421
422 - Default: null
423 - Type: null or Number
424
425 When creating a Granular Access Token with `npm token create`, this sets the expiration in days. If not specified, the server will determine the default expiration.
426
427 #### `fetch-retries`
428
429 - Default: 2
430 - Type: Number
431
432 The "retries" config for the `retry` module to use when fetching packages from the registry.
433
434 npm will retry idempotent read requests to the registry in the case of network failures or 5xx HTTP errors.
435
436 #### `fetch-retry-factor`
437
438 - Default: 10
439 - Type: Number
440
441 The "factor" config for the `retry` module to use when fetching packages.
442
443 #### `fetch-retry-maxtimeout`
444
445 - Default: 60000 (1 minute)
446 - Type: Number
447
448 The "maxTimeout" config for the `retry` module to use when fetching packages.
449
450 #### `fetch-retry-mintimeout`
451
452 - Default: 10000 (10 seconds)
453 - Type: Number
454
455 The "minTimeout" config for the `retry` module to use when fetching packages.
456
457 #### `fetch-timeout`
458
459 - Default: 300000 (5 minutes)
460 - Type: Number
461
462 The maximum amount of time to wait for HTTP requests to complete.
463
464 #### `force`
465
466 - Default: false
467 - Type: Boolean
468
469 Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input.
470
471 - Allow clobbering non-npm files in global installs.
472 - Allow the `npm version` command to work on an unclean git repository.
473 - Allow deleting the cache folder with `npm cache clean`.
474 - Allow installing packages that have an `engines` declaration requiring a different version of npm.
475 - Allow installing packages that have an `engines` declaration requiring a different version of `node`, even if `--engine-strict` is enabled.
476 - Allow `npm audit fix` to install modules outside your stated dependency range (including SemVer-major changes).
477 - Allow unpublishing all versions of a published package.
478 - Allow conflicting peerDependencies to be installed in the root project.
479 - Implicitly set `--yes` during `npm init`.
480 - Allow clobbering existing values in `npm pkg`
481 - Allow unpublishing of entire packages (not just a single version).
482
483 If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option!
484
485 #### `foreground-scripts`
486
487 - Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
488 - Type: Boolean
489
490 Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
491
492 Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging.
493
494 #### `format-package-lock`
495
496 - Default: true
497 - Type: Boolean
498
499 Format `package-lock.json` or `npm-shrinkwrap.json` as a human readable file.
500
501 #### `fund`
502
503 - Default: true
504 - Type: Boolean
505
506 When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v11/commands/npm-fund) for details.
507
508 #### `git`
509
510 - Default: "git"
511 - Type: String
512
513 The command to use for git commands. If git is installed on the computer, but is not in the `PATH`, then set this to the full path to the git binary.
514
515 #### `git-tag-version`
516
517 - Default: true
518 - Type: Boolean
519
520 Tag the commit when using the `npm version` command. Setting this to false results in no commit being made at all.
521
522 #### `global`
523
524 - Default: false
525 - Type: Boolean
526
527 Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See [folders](/cli/v11/configuring-npm/folders) for more on the differences in behavior.
528
529 - packages are installed into the `{prefix}/lib/node_modules` folder, instead of the current working directory.
530 - bin files are linked to `{prefix}/bin`
531 - man pages are linked to `{prefix}/share/man`
532
533 #### `globalconfig`
534
535 - Default: The global --prefix setting plus 'etc/npmrc'. For example, '/usr/local/etc/npmrc'
536 - Type: Path
537
538 The config file to read for global config options.
539
540 #### `heading`
541
542 - Default: "npm"
543 - Type: String
544
545 The string that starts all the debugging log output.
546
547 #### `https-proxy`
548
549 - Default: null
550 - Type: null or URL
551
552 A proxy to use for outgoing https requests. If the `HTTPS_PROXY` or `https_proxy` or `HTTP_PROXY` or `http_proxy` environment variables are set, proxy settings will be honored by the underlying `make-fetch-happen` library.
553
554 #### `if-present`
555
556 - Default: false
557 - Type: Boolean
558
559 If true, npm will not exit with an error code when `run` is invoked for a script that isn't defined in the `scripts` section of `package.json`. This option can be used when it's desirable to optionally run a script when it's present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup.
560
561 This value is not exported to the environment for child processes.
562
563 #### `ignore-scripts`
564
565 - Default: false
566 - Type: Boolean
567
568 If true, npm does not run scripts specified in package.json files.
569
570 Note that commands explicitly intended to run a particular script, such as `npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still run their intended script if `ignore-scripts` is set, but they will _not_ run any pre- or post-scripts.
571
572 #### `include`
573
574 - Default:
575 - Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
576
577 Option that allows for defining which types of dependencies to install.
578
579 This is the inverse of `--omit=<type>`.
580
581 Dependency types specified in `--include` will not be omitted, regardless of the order in which omit/include are specified on the command-line.
582
583 #### `include-staged`
584
585 - Default: false
586 - Type: Boolean
587
588 Allow installing "staged" published packages, as defined by [npm RFC PR #92](https://github.com/npm/rfcs/pull/92).
589
590 This is experimental, and not implemented by the npm public registry.
591
592 #### `include-workspace-root`
593
594 - Default: false
595 - Type: Boolean
596
597 Include the workspace root when workspaces are enabled for a command.
598
599 When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project.
600
601 This value is not exported to the environment for child processes.
602
603 #### `init-author-email`
604
605 - Default: ""
606 - Type: String
607
608 The value `npm init` should use by default for the package author's email.
609
610 #### `init-author-name`
611
612 - Default: ""
613 - Type: String
614
615 The value `npm init` should use by default for the package author's name.
616
617 #### `init-author-url`
618
619 - Default: ""
620 - Type: "" or URL
621
622 The value `npm init` should use by default for the package author's homepage.
623
624 #### `init-license`
625
626 - Default: "ISC"
627 - Type: String
628
629 The value `npm init` should use by default for the package license.
630
631 #### `init-module`
632
633 - Default: "~/.npm-init.js"
634 - Type: Path
635
636 A module that will be loaded by the `npm init` command. See the documentation for the [init-package-json](https://github.com/npm/init-package-json) module for more information, or [npm init](/cli/v11/commands/npm-init).
637
638 #### `init-private`
639
640 - Default: false
641 - Type: Boolean
642
643 The value `npm init` should use by default for the package's private flag.
644
645 #### `init-type`
646
647 - Default: "commonjs"
648 - Type: String
649
650 The value that `npm init` should use by default for the package.json type field.
651
652 #### `init-version`
653
654 - Default: "1.0.0"
655 - Type: SemVer string
656
657 The value that `npm init` should use by default for the package version number, if not already set in package.json.
658
659 #### `install-links`
660
661 - Default: false
662 - Type: Boolean
663
664 When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces.
665
666 #### `install-strategy`
667
668 - Default: "hoisted"
669 - Type: "hoisted", "nested", "shallow", or "linked"
670
671 Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted.
672
673 #### `json`
674
675 - Default: false
676 - Type: Boolean
677
678 Whether or not to output JSON data, rather than the normal output.
679
680 - In `npm pkg set` it enables parsing set values with JSON.parse() before saving them to your `package.json`.
681
682 Not supported by all npm commands.
683
684 #### `legacy-peer-deps`
685
686 - Default: false
687 - Type: Boolean
688
689 Causes npm to completely ignore `peerDependencies` when building a package tree, as in npm versions 3 through 6.
690
691 If a package cannot be installed because of overly strict `peerDependencies` that collide, it provides a way to move forward resolving the situation.
692
693 This differs from `--omit=peer`, in that `--omit=peer` will avoid unpacking `peerDependencies` on disk, but will still design a tree such that `peerDependencies` _could_ be unpacked in a correct place.
694
695 Use of `legacy-peer-deps` is not recommended, as it will not enforce the `peerDependencies` contract that meta-dependencies may rely on.
696
697 #### `libc`
698
699 - Default: null
700 - Type: null or String
701
702 Override libc of native modules to install. Acceptable values are same as `libc` field of package.json
703
704 #### `link`
705
706 - Default: false
707 - Type: Boolean
708
709 Used with `npm ls`, limiting output to only those packages that are linked.
710
711 #### `local-address`
712
713 - Default: null
714 - Type: IP Address
715
716 The IP address of the local interface to use when making connections to the npm registry. Must be IPv4 in versions of Node prior to 0.12.
717
718 #### `location`
719
720 - Default: "user" unless `--global` is passed, which will also set this value to "global"
721 - Type: "global", "user", or "project"
722
723 When passed to `npm config` this refers to which config file to use.
724
725 When set to "global" mode, packages are installed into the `prefix` folder instead of the current working directory. See [folders](/cli/v11/configuring-npm/folders) for more on the differences in behavior.
726
727 - packages are installed into the `{prefix}/lib/node_modules` folder, instead of the current working directory.
728 - bin files are linked to `{prefix}/bin`
729 - man pages are linked to `{prefix}/share/man`
730
731 #### `lockfile-version`
732
733 - Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3; otherwise, maintain current lockfile version.
734 - Type: null, 1, 2, 3, "1", "2", or "3"
735
736 Set the lockfile format version to be used in package-lock.json and npm-shrinkwrap-json files. Possible options are:
737
738 1: The lockfile version used by npm versions 5 and 6. Lacks some data that is used during the install, resulting in slower and possibly less deterministic installs. Prevents lockfile churn when interoperating with older npm versions.
739
740 2: The default lockfile version used by npm version 7 and 8. Includes both the version 1 lockfile data and version 3 lockfile data, for maximum determinism and interoperability, at the expense of more bytes on disk.
741
742 3: Only the new lockfile information introduced in npm version 7. Smaller on disk than lockfile version 2, but not interoperable with older npm versions. Ideal if all users are on npm version 7 and higher.
743
744 #### `loglevel`
745
746 - Default: "notice"
747 - Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or "silly"
748
749 What level of logs to report. All logs are written to a debug log, with the path to that file printed if the execution of a command fails.
750
751 Any logs of a higher level than the setting are shown. The default is "notice".
752
753 See also the `foreground-scripts` config.
754
755 #### `logs-dir`
756
757 - Default: A directory named `_logs` inside the cache
758 - Type: null or Path
759
760 The location of npm's log directory. See [`npm logging`](/cli/v11/using-npm/logging) for more information.
761
762 #### `logs-max`
763
764 - Default: 10
765 - Type: Number
766
767 The maximum number of log files to store.
768
769 If set to 0, no log files will be written for the current run.
770
771 #### `long`
772
773 - Default: false
774 - Type: Boolean
775
776 Show extended information in `ls`, `search`, and `help-search`.
777
778 #### `maxsockets`
779
780 - Default: 15
781 - Type: Number
782
783 The maximum number of connections to use per origin (protocol/host/port combination).
784
785 #### `message`
786
787 - Default: "%s"
788 - Type: String
789
790 Commit message which is used by `npm version` when creating version commit.
791
792 Any "%s" in the message will be replaced with the version number.
793
794 #### `min-release-age`
795
796 - Default: null
797 - Type: null or Number
798
799 If set, npm will build the npm tree such that only versions that were available more than the given number of days ago will be installed. If there are no versions available for the current set of dependencies, the command will error.
800
801 This flag is a complement to `before`, which accepts an exact date instead of a relative number of days.
802
803 This config cannot be used with: `before`
804
805 #### `name`
806
807 - Default: null
808 - Type: null or String
809
810 When creating a Granular Access Token with `npm token create`, this sets the name/description for the token.
811
812 #### `node-gyp`
813
814 - Default: The path to the node-gyp bin that ships with npm
815 - Type: Path
816
817 This is the location of the "node-gyp" bin. By default it uses one that ships with npm itself.
818
819 You can use this config to specify your own "node-gyp" to run when it is required to build a package.
820
821 #### `node-options`
822
823 - Default: null
824 - Type: null or String
825
826 Options to pass through to Node.js via the `NODE_OPTIONS` environment variable. This does not impact how npm itself is executed but it does impact how lifecycle scripts are called.
827
828 #### `noproxy`
829
830 - Default: The value of the NO_PROXY environment variable
831 - Type: String (can be set multiple times)
832
833 Domain extensions that should bypass any proxies.
834
835 Also accepts a comma-delimited string.
836
837 #### `offline`
838
839 - Default: false
840 - Type: Boolean
841
842 Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see `--prefer-offline`.
843
844 #### `omit`
845
846 - Default: 'dev' if the `NODE_ENV` environment variable is set to 'production'; otherwise, empty.
847 - Type: "dev", "optional", or "peer" (can be set multiple times)
848
849 Dependency types to omit from the installation tree on disk.
850
851 Note that these dependencies _are_ still resolved and added to the `package-lock.json` or `npm-shrinkwrap.json` file. They are just not physically installed on disk.
852
853 If a package type appears in both the `--include` and `--omit` lists, then it will be included.
854
855 If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts.
856
857 #### `omit-lockfile-registry-resolved`
858
859 - Default: false
860 - Type: Boolean
861
862 This option causes npm to create lock files without a `resolved` key for registry dependencies. Subsequent installs will need to resolve tarball endpoints with the configured registry, likely resulting in a longer install time.
863
864 #### `orgs`
865
866 - Default: null
867 - Type: null or String (can be set multiple times)
868
869 When creating a Granular Access Token with `npm token create`, this limits the token access to specific organizations.
870
871 #### `orgs-permission`
872
873 - Default: null
874 - Type: null, "read-only", "read-write", or "no-access"
875
876 When creating a Granular Access Token with `npm token create`, sets the permission level for organizations. Options are "read-only", "read-write", or "no-access".
877
878 #### `os`
879
880 - Default: null
881 - Type: null or String
882
883 Override OS of native modules to install. Acceptable values are same as `os` field of package.json, which comes from `process.platform`.
884
885 #### `otp`
886
887 - Default: null
888 - Type: null or String
889
890 This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with `npm access`.
891
892 If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one.
893
894 #### `pack-destination`
895
896 - Default: "."
897 - Type: String
898
899 Directory in which `npm pack` will save tarballs.
900
901 #### `package`
902
903 - Default:
904 - Type: String (can be set multiple times)
905
906 The package or packages to install for [`npm exec`](/cli/v11/commands/npm-exec)
907
908 #### `package-lock`
909
910 - Default: true
911 - Type: Boolean
912
913 If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true.
914
915 #### `package-lock-only`
916
917 - Default: false
918 - Type: Boolean
919
920 If set to true, the current operation will only use the `package-lock.json`, ignoring `node_modules`.
921
922 For `update` this means only the `package-lock.json` will be updated, instead of checking `node_modules` and downloading dependencies.
923
924 For `list` this means the output will be based on the tree described by the `package-lock.json`, rather than the contents of `node_modules`.
925
926 #### `packages`
927
928 - Default:
929 - Type: null or String (can be set multiple times)
930
931 When creating a Granular Access Token with `npm token create`, this limits the token access to specific packages.
932
933 #### `packages-all`
934
935 - Default: false
936 - Type: Boolean
937
938 When creating a Granular Access Token with `npm token create`, grants the token access to all packages instead of limiting to specific packages.
939
940 #### `packages-and-scopes-permission`
941
942 - Default: null
943 - Type: null, "read-only", "read-write", or "no-access"
944
945 When creating a Granular Access Token with `npm token create`, sets the permission level for packages and scopes. Options are "read-only", "read-write", or "no-access".
946
947 #### `parseable`
948
949 - Default: false
950 - Type: Boolean
951
952 Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format.
953
954 #### `password`
955
956 - Default: null
957 - Type: null or String
958
959 Password for authentication. Can be provided via command line when creating tokens, though it's generally safer to be prompted for it.
960
961 #### `prefer-dedupe`
962
963 - Default: false
964 - Type: Boolean
965
966 Prefer to deduplicate packages if possible, rather than choosing a newer version of a dependency.
967
968 #### `prefer-offline`
969
970 - Default: false
971 - Type: Boolean
972
973 If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use `--offline`.
974
975 #### `prefer-online`
976
977 - Default: false
978 - Type: Boolean
979
980 If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data.
981
982 #### `prefix`
983
984 - Default: In global mode, the folder where the node executable is installed. Otherwise, the nearest parent folder containing either a package.json file or a node_modules folder.
985 - Type: Path
986
987 The location to install global items. If set on the command line, then it forces non-global commands to run in the specified folder.
988
989 #### `preid`
990
991 - Default: ""
992 - Type: String
993
994 The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the `rc` in `1.2.0-rc.8`.
995
996 #### `progress`
997
998 - Default: `true` when not in CI and both stderr and stdout are TTYs and not in a dumb terminal
999 - Type: Boolean
1000
1001 When set to `true`, npm will display a progress bar during time intensive operations, if `process.stderr` and `process.stdout` are a TTY.
1002
1003 Set to `false` to suppress the progress bar.
1004
1005 #### `provenance`
1006
1007 - Default: false
1008 - Type: Boolean
1009
1010 When publishing from a supported cloud CI/CD system, the package will be publicly linked to where it was built and published from.
1011
1012 This config cannot be used with: `provenance-file`
1013
1014 #### `provenance-file`
1015
1016 - Default: null
1017 - Type: Path
1018
1019 When publishing, the provenance bundle at the given path will be used.
1020
1021 This config cannot be used with: `provenance`
1022
1023 #### `proxy`
1024
1025 - Default: null
1026 - Type: null, false, or URL
1027
1028 A proxy to use for outgoing http requests. If the `HTTP_PROXY` or `http_proxy` environment variables are set, proxy settings will be honored by the underlying `request` library.
1029
1030 #### `read-only`
1031
1032 - Default: false
1033 - Type: Boolean
1034
1035 This is used to mark a token as unable to publish when configuring limited access tokens with the `npm token create` command.
1036
1037 #### `rebuild-bundle`
1038
1039 - Default: true
1040 - Type: Boolean
1041
1042 Rebuild bundled dependencies after installation.
1043
1044 #### `registry`
1045
1046 - Default: "https://registry.npmjs.org/"
1047 - Type: URL
1048
1049 The base URL of the npm registry.
1050
1051 #### `replace-registry-host`
1052
1053 - Default: "npmjs"
1054 - Type: "npmjs", "never", "always", or String
1055
1056 Defines behavior for replacing the registry host in a lockfile with the configured registry.
1057
1058 The default behavior is to replace package dist URLs from the default registry (https://registry.npmjs.org) to the configured registry. If set to "never", then use the registry value. If set to "always", then replace the registry host with the configured host every time.
1059
1060 You may also specify a bare hostname (e.g., "registry.npmjs.org").
1061
1062 #### `save`
1063
1064 - Default: `true` unless when using `npm update` where it defaults to `false`
1065 - Type: Boolean
1066
1067 Save installed packages to a `package.json` file as dependencies.
1068
1069 When used with the `npm rm` command, removes the dependency from `package.json`.
1070
1071 Will also prevent writing to `package-lock.json` if set to `false`.
1072
1073 #### `save-bundle`
1074
1075 - Default: false
1076 - Type: Boolean
1077
1078 If a package would be saved at install time by the use of `--save`, `--save-dev`, or `--save-optional`, then also put it in the `bundleDependencies` list.
1079
1080 Ignored if `--save-peer` is set, since peerDependencies cannot be bundled.
1081
1082 #### `save-dev`
1083
1084 - Default: false
1085 - Type: Boolean
1086
1087 Save installed packages to a package.json file as `devDependencies`.
1088
1089 This config cannot be used with: `save-optional`, `save-peer`, `save-prod`
1090
1091 #### `save-exact`
1092
1093 - Default: false
1094 - Type: Boolean
1095
1096 Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator.
1097
1098 #### `save-optional`
1099
1100 - Default: false
1101 - Type: Boolean
1102
1103 Save installed packages to a package.json file as `optionalDependencies`.
1104
1105 This config cannot be used with: `save-dev`, `save-peer`, `save-prod`
1106
1107 #### `save-peer`
1108
1109 - Default: false
1110 - Type: Boolean
1111
1112 Save installed packages to a package.json file as `peerDependencies`
1113
1114 This config cannot be used with: `save-dev`, `save-optional`, `save-prod`
1115
1116 #### `save-prefix`
1117
1118 - Default: "^"
1119 - Type: String
1120
1121 Configure how versions of packages installed to a package.json file via `--save` or `--save-dev` get prefixed.
1122
1123 For example if a package has version `1.2.3`, by default its version is set to `^1.2.3` which allows minor upgrades for that package, but after `npm config set save-prefix='~'` it would be set to `~1.2.3` which only allows patch upgrades.
1124
1125 #### `save-prod`
1126
1127 - Default: false
1128 - Type: Boolean
1129
1130 Save installed packages into `dependencies` specifically. This is useful if a package already exists in `devDependencies` or `optionalDependencies`, but you want to move it to be a non-optional production dependency.
1131
1132 This is the default behavior if `--save` is true, and neither `--save-dev` or `--save-optional` are true.
1133
1134 This config cannot be used with: `save-dev`, `save-optional`, `save-peer`
1135
1136 #### `sbom-format`
1137
1138 - Default: null
1139 - Type: "cyclonedx" or "spdx"
1140
1141 SBOM format to use when generating SBOMs.
1142
1143 #### `sbom-type`
1144
1145 - Default: "library"
1146 - Type: "library", "application", or "framework"
1147
1148 The type of package described by the generated SBOM. For SPDX, this is the value for the `primaryPackagePurpose` field. For CycloneDX, this is the value for the `type` field.
1149
1150 #### `scope`
1151
1152 - Default: the scope of the current project, if any, or ""
1153 - Type: String
1154
1155 Associate an operation with a scope for a scoped registry.
1156
1157 Useful when logging in to or out of a private registry:
1158
1159 ```
1160 # log in, linking the scope to the custom registry
1161 npm login --scope=@mycorp --registry=https://registry.mycorp.com
1162
1163 # log out, removing the link and the auth token
1164 npm logout --scope=@mycorp
1165 ```
1166
1167 This will cause `@mycorp` to be mapped to the registry for future installation of packages specified according to the pattern `@mycorp/package`.
1168
1169 This will also cause `npm init` to create a scoped package.
1170
1171 ```
1172 # accept all defaults, and create a package named "@foo/whatever",
1173 # instead of just named "whatever"
1174 npm init --scope=@foo --yes
1175 ```
1176
1177 #### `scopes`
1178
1179 - Default: null
1180 - Type: null or String (can be set multiple times)
1181
1182 When creating a Granular Access Token with `npm token create`, this limits the token access to specific scopes. Provide a scope name (with or without @ prefix).
1183
1184 #### `script-shell`
1185
1186 - Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
1187 - Type: null or String
1188
1189 The shell to use for scripts run with the `npm exec`, `npm run` and `npm init <package-spec>` commands.
1190
1191 #### `searchexclude`
1192
1193 - Default: ""
1194 - Type: String
1195
1196 Space-separated options that limit the results from search.
1197
1198 #### `searchlimit`
1199
1200 - Default: 20
1201 - Type: Number
1202
1203 Number of items to limit search results to. Will not apply at all to legacy searches.
1204
1205 #### `searchopts`
1206
1207 - Default: ""
1208 - Type: String
1209
1210 Space-separated options that are always passed to search.
1211
1212 #### `searchstaleness`
1213
1214 - Default: 900
1215 - Type: Number
1216
1217 The age of the cache, in seconds, before another registry request is made if using legacy search endpoint.
1218
1219 #### `shell`
1220
1221 - Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on Windows
1222 - Type: String
1223
1224 The shell to run for the `npm explore` command.
1225
1226 #### `sign-git-commit`
1227
1228 - Default: false
1229 - Type: Boolean
1230
1231 If set to true, then the `npm version` command will commit the new package version using `-S` to add a signature.
1232
1233 Note that git requires you to have set up GPG keys in your git configs for this to work properly.
1234
1235 #### `sign-git-tag`
1236
1237 - Default: false
1238 - Type: Boolean
1239
1240 If set to true, then the `npm version` command will tag the version using `-s` to add a signature.
1241
1242 Note that git requires you to have set up GPG keys in your git configs for this to work properly.
1243
1244 #### `strict-peer-deps`
1245
1246 - Default: false
1247 - Type: Boolean
1248
1249 If set to `true`, and `--legacy-peer-deps` is not set, then _any_ conflicting `peerDependencies` will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships.
1250
1251 By default, conflicting `peerDependencies` deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's `peerDependencies` object.
1252
1253 When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure.
1254
1255 #### `strict-ssl`
1256
1257 - Default: true
1258 - Type: Boolean
1259
1260 Whether or not to do SSL key validation when making requests to the registry via https.
1261
1262 See also the `ca` config.
1263
1264 #### `tag`
1265
1266 - Default: "latest"
1267 - Type: String
1268
1269 If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag.
1270
1271 It is the tag added to the package@version specified in the `npm dist-tag add` command, if no explicit tag is given.
1272
1273 When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default.
1274
1275 If used in the `npm publish` command, this is the tag that will be added to the package submitted to the registry.
1276
1277 #### `tag-version-prefix`
1278
1279 - Default: "v"
1280 - Type: String
1281
1282 If set, alters the prefix used when tagging a new version when performing a version increment using `npm version`. To remove the prefix altogether, set it to the empty string: `""`.
1283
1284 Because other tools may rely on the convention that npm version tags look like `v1.0.0`, _only use this property if it is absolutely necessary_. In particular, use care when overriding this setting for public packages.
1285
1286 #### `timing`
1287
1288 - Default: false
1289 - Type: Boolean
1290
1291 If true, writes timing information to a process specific json file in the cache or `logs-dir`. The file name ends with `-timing.json`.
1292
1293 You can quickly view it with this [json](https://npm.im/json) command line: `cat ~/.npm/_logs/*-timing.json | npm exec -- json -g`.
1294
1295 Timing information will also be reported in the terminal. To suppress this while still writing the timing file, use `--silent`.
1296
1297 #### `token-description`
1298
1299 - Default: null
1300 - Type: null or String
1301
1302 Description text for the token when using `npm token create`.
1303
1304 #### `umask`
1305
1306 - Default: 0
1307 - Type: Octal numeric string in range 0000..0777 (0..511)
1308
1309 The "umask" value to use when setting the file creation mode on files and folders.
1310
1311 Folders and executables are given a mode which is `0o777` masked against this value. Other files are given a mode which is `0o666` masked against this value.
1312
1313 Note that the underlying system will _also_ apply its own umask value to files and folders that are created, and npm does not circumvent this, but rather adds the `--umask` config to it.
1314
1315 Thus, the effective default umask value on most POSIX systems is 0o22, meaning that folders and executables are created with a mode of 0o755 and other files are created with a mode of 0o644.
1316
1317 #### `unicode`
1318
1319 - Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
1320 - Type: Boolean
1321
1322 When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs.
1323
1324 #### `update-notifier`
1325
1326 - Default: true
1327 - Type: Boolean
1328
1329 Set to false to suppress the update notification when using an older version of npm than the latest.
1330
1331 #### `usage`
1332
1333 - Default: false
1334 - Type: Boolean
1335
1336 Show short usage output about the command specified.
1337
1338 #### `user-agent`
1339
1340 - Default: "npm/\{npm-version\} node/\{node-version\} \{platform\} \{arch\} workspaces/\{workspaces\} \{ci\}"
1341 - Type: String
1342
1343 Sets the User-Agent request header. The following fields are replaced with their actual counterparts:
1344
1345 - `{npm-version}` - The npm version in use
1346 - `{node-version}` - The Node.js version in use
1347 - `{platform}` - The value of `process.platform`
1348 - `{arch}` - The value of `process.arch`
1349 - `{workspaces}` - Set to `true` if the `workspaces` or `workspace` options are set.
1350 - `{ci}` - The value of the `ci-name` config, if set, prefixed with `ci/`, or an empty string if `ci-name` is empty.
1351
1352 #### `userconfig`
1353
1354 - Default: "~/.npmrc"
1355 - Type: Path
1356
1357 The location of user-level configuration settings.
1358
1359 This may be overridden by the `npm_config_userconfig` environment variable or the `--userconfig` command line option, but may _not_ be overridden by settings in the `globalconfig` file.
1360
1361 #### `version`
1362
1363 - Default: false
1364 - Type: Boolean
1365
1366 If true, output the npm version and exit successfully.
1367
1368 Only relevant when specified explicitly on the command line.
1369
1370 #### `versions`
1371
1372 - Default: false
1373 - Type: Boolean
1374
1375 If true, output the npm version as well as node's `process.versions` map and the version in the current working directory's `package.json` file if one exists, and exit successfully.
1376
1377 Only relevant when specified explicitly on the command line.
1378
1379 #### `viewer`
1380
1381 - Default: "man" on Posix, "browser" on Windows
1382 - Type: String
1383
1384 The program to use to view help content.
1385
1386 Set to `"browser"` to view html help content in the default web browser.
1387
1388 #### `which`
1389
1390 - Default: null
1391 - Type: null or Number
1392
1393 If there are multiple funding sources, which 1-indexed source URL to open.
1394
1395 #### `workspace`
1396
1397 - Default:
1398 - Type: String (can be set multiple times)
1399
1400 Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.
1401
1402 Valid values for the `workspace` config are either:
1403
1404 - Workspace names
1405 - Path to a workspace directory
1406 - Path to a parent workspace directory (will result in selecting all workspaces within that folder)
1407
1408 When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project.
1409
1410 This value is not exported to the environment for child processes.
1411
1412 #### `workspaces`
1413
1414 - Default: null
1415 - Type: null or Boolean
1416
1417 Set to true to run the command in the context of **all** configured workspaces.
1418
1419 Explicitly setting this to false will cause commands like `install` to ignore workspaces altogether. When not set explicitly:
1420
1421 - Commands that operate on the `node_modules` tree (install, update, etc.) will link workspaces into the `node_modules` folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, _unless_ one or more workspaces are specified in the `workspace` config.
1422
1423 This value is not exported to the environment for child processes.
1424
1425 #### `workspaces-update`
1426
1427 - Default: true
1428 - Type: Boolean
1429
1430 If set to true, the npm cli will run an update after operations that may possibly change the workspaces installed to the `node_modules` folder.
1431
1432 #### `yes`
1433
1434 - Default: null
1435 - Type: null or Boolean
1436
1437 Automatically answer "yes" to any prompts that npm might print on the command line.
1438
1439 #### `also`
1440
1441 - Default: null
1442 - Type: null, "dev", or "development"
1443 - DEPRECATED: Please use --include=dev instead.
1444
1445 When set to `dev` or `development`, this is an alias for `--include=dev`.
1446
1447 #### `cache-max`
1448
1449 - Default: Infinity
1450 - Type: Number
1451 - DEPRECATED: This option has been deprecated in favor of `--prefer-online`
1452
1453 `--cache-max=0` is an alias for `--prefer-online`
1454
1455 #### `cache-min`
1456
1457 - Default: 0
1458 - Type: Number
1459 - DEPRECATED: This option has been deprecated in favor of `--prefer-offline`.
1460
1461 `--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.
1462
1463 #### `cert`
1464
1465 - Default: null
1466 - Type: null or String
1467 - DEPRECATED: `key` and `cert` are no longer used for most registry operations. Use registry scoped `keyfile` and `certfile` instead. Example: //other-registry.tld/:keyfile=/path/to/key.pem //other-registry.tld/:certfile=/path/to/cert.crt
1468
1469 A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\n". For example:
1470
1471 ```ini
1472 cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
1473 ```
1474
1475 It is _not_ the path to a certificate file, though you can set a registry-scoped "certfile" path like "//other-registry.tld/:certfile=/path/to/cert.pem".
1476
1477 #### `dev`
1478
1479 - Default: false
1480 - Type: Boolean
1481 - DEPRECATED: Please use --include=dev instead.
1482
1483 Alias for `--include=dev`.
1484
1485 #### `global-style`
1486
1487 - Default: false
1488 - Type: Boolean
1489 - DEPRECATED: This option has been deprecated in favor of `--install-strategy=shallow`
1490
1491 Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`.
1492
1493 #### `init.author.email`
1494
1495 - Default: ""
1496 - Type: String
1497 - DEPRECATED: Use `--init-author-email` instead.
1498
1499 Alias for `--init-author-email`
1500
1501 #### `init.author.name`
1502
1503 - Default: ""
1504 - Type: String
1505 - DEPRECATED: Use `--init-author-name` instead.
1506
1507 Alias for `--init-author-name`
1508
1509 #### `init.author.url`
1510
1511 - Default: ""
1512 - Type: "" or URL
1513 - DEPRECATED: Use `--init-author-url` instead.
1514
1515 Alias for `--init-author-url`
1516
1517 #### `init.license`
1518
1519 - Default: "ISC"
1520 - Type: String
1521 - DEPRECATED: Use `--init-license` instead.
1522
1523 Alias for `--init-license`
1524
1525 #### `init.module`
1526
1527 - Default: "~/.npm-init.js"
1528 - Type: Path
1529 - DEPRECATED: Use `--init-module` instead.
1530
1531 Alias for `--init-module`
1532
1533 #### `init.version`
1534
1535 - Default: "1.0.0"
1536 - Type: SemVer string
1537 - DEPRECATED: Use `--init-version` instead.
1538
1539 Alias for `--init-version`
1540
1541 #### `key`
1542
1543 - Default: null
1544 - Type: null or String
1545 - DEPRECATED: `key` and `cert` are no longer used for most registry operations. Use registry scoped `keyfile` and `certfile` instead. Example: //other-registry.tld/:keyfile=/path/to/key.pem //other-registry.tld/:certfile=/path/to/cert.crt
1546
1547 A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string "\n". For example:
1548
1549 ```ini
1550 key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
1551 ```
1552
1553 It is _not_ the path to a key file, though you can set a registry-scoped "keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
1554
1555 #### `legacy-bundling`
1556
1557 - Default: false
1558 - Type: Boolean
1559 - DEPRECATED: This option has been deprecated in favor of `--install-strategy=nested`
1560
1561 Instead of hoisting package installs in `node_modules`, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets `--install-strategy=nested`.
1562
1563 #### `only`
1564
1565 - Default: null
1566 - Type: null, "prod", or "production"
1567 - DEPRECATED: Use `--omit=dev` to omit dev dependencies from the install.
1568
1569 When set to `prod` or `production`, this is an alias for `--omit=dev`.
1570
1571 #### `optional`
1572
1573 - Default: null
1574 - Type: null or Boolean
1575 - DEPRECATED: Use `--omit=optional` to exclude optional dependencies, or `--include=optional` to include them.
1576
1577 Default value does install optional deps unless otherwise omitted.
1578
1579 Alias for --include=optional or --omit=optional
1580
1581 #### `production`
1582
1583 - Default: null
1584 - Type: null or Boolean
1585 - DEPRECATED: Use `--omit=dev` instead.
1586
1587 Alias for `--omit=dev`
1588
1589 #### `shrinkwrap`
1590
1591 - Default: true
1592 - Type: Boolean
1593 - DEPRECATED: Use the --package-lock setting instead.
1594
1595 Alias for --package-lock
1596
1597 ### See also
1598
1599 - [npm config](/cli/v11/commands/npm-config)
1600 - [npmrc](/cli/v11/configuring-npm/npmrc)
1601 - [npm scripts](/cli/v11/using-npm/scripts)
1602 - [npm folders](/cli/v11/configuring-npm/folders)
1603 - [npm](/cli/v11/commands/npm)