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