NPM-CONFIG(1)
π npm-config β bestie's guide to the npm config files π
okay so this is npm-config from the npm manual, and we're gonna get you so comfy with it. it's the whole "manage the npm configuration files" situation. let's go β¨
π Synopsis
npm config set <key>=<value> [<key>=<value> ...]
npm config get [<key> [<key> ...]]
npm config delete <key> [<key> ...]
npm config list [--json]
npm config edit
npm config fix
alias: c
π«Ά heads up bestie: this command is unaware of workspaces. like, it literally does not know they exist. no cap.
πΈ Description
so like, where does npm even get its config from? iconic question. npm pulls its settings from:
- the command line
- environment variables
npmrcfiles- and in some cases, the
package.jsonfile
for the whole tea on npmrc files, run npm help npmrc.
and if you want a much more thorough explanation of the mechanisms in play plus a full list of every config option available β npm help config. it's giving encyclopedia. π
the npm config command is your girl for updating and editing the contents of the user and global npmrc files. main character energy fr.
β Sub-commands
Config supports these sub-commands, and each one ate:
π set
npm config set key=value [key=value...]
npm set key=value [key=value...]
sets each of the config keys to the value you provided. it modifies the user configuration file unless location β¨/commands/npm-config#locationβ© is passed. (iykyk π)
if the value is omitted, the key gets removed from your config file entirely. gone. poof. no trace. π
note: for backwards compatibility,npm config set key valueis supported as an alias fornpm config set key=value. so both work, bestie.
π¦ get
npm config get [key ...]
npm get [key ...]
echoes the config value(s) to stdout. that's it, that's the vibe.
if you pass multiple keys, the values get prefixed with the key names so you can tell which is which. bless.
if you pass no keys at all, this command behaves the same as npm config list. literally the same thing. π
π list
npm config list
shows all the config settings. use -l to also show the defaults. use --json to show the settings in json format. cute and structured, we love.
π§ delete
npm config delete key [key ...]
deletes the specified keys from all configuration files. all of them. every single one. π
π edit
npm config edit
opens the config file in an editor. use the --global flag to edit the global config instead. (editor pick is a whole thing β see the editor config down below β¬οΈ)
πΈ fix
npm config fix
attempts to repair invalid configuration items. usually this means attaching authentication config (i.e. _auth, _authToken) to the configured registry. it's like a little glow-up for your broken config β¨
π Configuration
π json
- Default:
false - Type: Boolean
whether or not to output JSON data instead of the normal output.
- in
npm pkg setit enables parsing set values withJSON.parse()before saving them to yourpackage.json.
not supported by all npm commands. so like, don't come for me if one of them doesn't do it π
π global
- Default:
false - Type: Boolean
operates in "global" mode, so packages get installed into the prefix folder instead of the current working directory. see npm help folders for more on the differences in behavior.
- packages are installed into the
{prefix}/lib/node_modulesfolder, instead of the current working directory. - bin files are linked to
{prefix}/bin - man pages are linked to
{prefix}/share/man
π¦ editor
- Default: the
EDITORorVISUALenvironment variables, or'%SYSTEMROOT%\notepad.exe'on Windows, or'vi'on Unix systems - Type: String
the command to run for npm edit and npm config edit. pick your fighter π
π location
- Default:
"user"unless--globalis passed, which will also set this value to"global" - Type:
"global","user", or"project"
when passed to npm config this refers to which config file to use. yes, which file. that's the whole point.
when set to "global" mode, packages are installed into the prefix folder instead of the current working directory. see npm help folders for more on the differences in behavior.
- packages are installed into the
{prefix}/lib/node_modulesfolder, instead of the current working directory. - bin files are linked to
{prefix}/bin - man pages are linked to
{prefix}/share/man
(yes bestie, these bullets are the same as global up there β they're supposed to be. don't @ me, that's just what the page says π«Ά)
π long
- Default:
false - Type: Boolean
show extended information in ls, search, and help-search. more info, more slay.
β See Also
npm help foldersnpm help configpackage.jsonβ¨/configuring-npm/package-jsonβ©npm help npmrcnpm help npm
okay that's the whole thing and you ATE it. go forth and config with confidence, bestie ππ¦β¨
with love from NPM@12.2.1 Β· October 2026 Β· NPM-CONFIG(1) πΈππ
π¦ where this page comes from
- arch rolling: npm 12.2.1-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms