• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2section: cli-commands
3title: npm-config
4description: Manage the npm configuration files
5---
6
7# npm-config(1)
8
9## Manage the npm configuration files
10
11### Synopsis
12```bash
13npm config set <key> <value> [-g|--global]
14npm config get <key>
15npm config delete <key>
16npm config list [-l] [--json]
17npm config edit
18npm get <key>
19npm set <key> <value> [-g|--global]
20
21aliases: c
22```
23
24### Description
25
26npm gets its config settings from the command line, environment
27variables, `npmrc` files, and in some cases, the `package.json` file.
28
29See [npmrc](/configuring-npm/npmrc) for more information about the npmrc files.
30
31See [config](/using-npm/config) for a more thorough discussion of the mechanisms
32involved.
33
34The `npm config` command can be used to update and edit the contents
35of the user and global npmrc files.
36
37### Sub-commands
38
39Config supports the following sub-commands:
40
41#### set
42```bash
43npm config set key value
44```
45Sets the config key to the value.
46
47If value is omitted, then it sets it to "true".
48
49#### get
50```bash
51npm config get key
52```
53
54Echo the config value to stdout.
55
56#### list
57```bash
58npm config list
59```
60
61Show all the config settings. Use `-l` to also show defaults. Use `--json`
62to show the settings in json format.
63
64#### delete
65```bash
66npm config delete key
67```
68
69Deletes the key from all configuration files.
70
71#### edit
72```bash
73npm config edit
74```
75
76Opens the config file in an editor.  Use the `--global` flag to edit the
77global config.
78
79### See Also
80
81* [npm folders](/configuring-npm/folders)
82* [npm config](/cli-commands/npm-config)
83* [package.json](/configuring-npm/package-json)
84* [npmrc](/configuring-npm/npmrc)
85* [npm](/cli-commands/npm)
86