2025-04-10 14:36:22 -07:00
.TH "NPM-CONFIG" "1" "April 2025" "NPM@11.3.0" ""
2013-07-12 08:55:57 -07:00
.SH "NAME"
2022-12-06 22:18:33 -05:00
\fB npm-config\fR - Manage the npm configuration files
.SS "Synopsis"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-12-06 22:18:33 -05:00
npm config set <key>=<value> \[ lB]<key>=<value> ...\[ rB]
npm config get \[ lB]<key> \[ lB]<key> ...\[ rB]\[ rB]
npm config delete <key> \[ lB]<key> ...\[ rB]
npm config list \[ lB]--json\[ rB]
2013-07-12 08:55:57 -07:00
npm config edit
2022-12-06 22:18:33 -05:00
npm config fix
2016-03-29 23:30:51 -07:00
2020-12-18 15:39:05 -05:00
alias: c
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2021-03-23 14:58:11 -04:00
.P
2022-12-06 22:18:33 -05:00
Note: This command is unaware of workspaces.
.SS "Description"
2014-09-24 14:41:07 -07:00
.P
2022-12-06 22:18:33 -05:00
npm gets its config settings from the command line, environment variables, \fB npmrc\fR files, and in some cases, the \fB package.json\fR file.
2013-07-12 08:55:57 -07:00
.P
2022-12-06 22:18:33 -05:00
See npm help npmrc for more information about the npmrc files.
2013-07-12 08:55:57 -07:00
.P
2022-12-06 22:18:33 -05:00
See npm help config for a more thorough explanation of the mechanisms involved, and a full list of config options available.
2013-07-12 08:55:57 -07:00
.P
2022-12-06 22:18:33 -05:00
The \fB npm config\fR command can be used to update and edit the contents of the user and global npmrc files.
.SS "Sub-commands"
2014-09-24 14:41:07 -07:00
.P
2022-12-06 22:18:33 -05:00
Config supports the following sub-commands:
.SS "set"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-12-06 22:18:33 -05:00
npm config set key=value \[ lB]key=value...\[ rB]
npm set key=value \[ lB]key=value...\[ rB]
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2013-07-12 08:55:57 -07:00
.P
2024-02-29 07:28:15 -08:00
Sets each of the config keys to the value provided. Modifies the user configuration file unless \fB \fB location\fR \fR \fI \(la /commands/npm-config#location\(ra \fR is passed.
2013-07-12 08:55:57 -07:00
.P
2023-05-07 03:37:34 -07:00
If value is omitted, the key will be removed from your config file entirely.
2020-12-18 15:39:05 -05:00
.P
2022-12-06 22:18:33 -05:00
Note: for backwards compatibility, \fB npm config set key value\fR is supported as an alias for \fB npm config set key=value\fR .
.SS "get"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-12-06 22:18:33 -05:00
npm config get \[ lB]key ...\[ rB]
npm get \[ lB]key ...\[ rB]
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2013-07-12 08:55:57 -07:00
.P
2022-12-06 22:18:33 -05:00
Echo the config value(s) to stdout.
2020-12-18 15:39:05 -05:00
.P
2022-12-06 22:18:33 -05:00
If multiple keys are provided, then the values will be prefixed with the key names.
2020-12-18 15:39:05 -05:00
.P
If no keys are provided, then this command behaves the same as \fB npm config
2022-12-06 22:18:33 -05:00
list\fR .
.SS "list"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2013-07-12 08:55:57 -07:00
npm config list
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2013-07-12 08:55:57 -07:00
.P
2022-12-06 22:18:33 -05:00
Show all the config settings. Use \fB -l\fR to also show defaults. Use \fB --json\fR to show the settings in json format.
.SS "delete"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-12-06 22:18:33 -05:00
npm config delete key \[ lB]key ...\[ rB]
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2013-07-12 08:55:57 -07:00
.P
2022-12-06 22:18:33 -05:00
Deletes the specified keys from all configuration files.
.SS "edit"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2013-07-12 08:55:57 -07:00
npm config edit
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2013-07-12 08:55:57 -07:00
.P
2022-12-06 22:18:33 -05:00
Opens the config file in an editor. Use the \fB --global\fR flag to edit the global config.
.SS "fix"
.P
.RS 2
.nf
npm config fix
.fi
.RE
.P
Attempts to repair invalid configuration items. Usually this means attaching authentication config (i.e. \fB _auth\fR , \fB _authToken\fR ) to the configured \fB registry\fR .
.SS "Configuration"
.SS "\fBjson\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default: false
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: Boolean
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Whether or not to output JSON data, rather than the normal output.
2021-07-15 20:09:18 +00:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
In \fB npm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fB package.json\fR .
.RE 0
2021-07-15 20:09:18 +00:00
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Not supported by all npm commands.
.SS "\fBglobal\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default: false
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: Boolean
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Operates in "global" mode, so that packages are installed into the \fB prefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior.
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
packages are installed into the \fB {prefix}/lib/node_modules\fR folder, instead of the current working directory.
.IP \(bu 4
bin files are linked to \fB {prefix}/bin\fR
.IP \(bu 4
man pages are linked to \fB {prefix}/share/man\fR
.RE 0
2021-05-20 15:54:50 -04:00
2022-12-06 22:18:33 -05:00
.SS "\fBeditor\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: The EDITOR or VISUAL environment variables, or '%SYSTEMROOT%\[ rs]notepad.exe' on Windows, or 'vi' on Unix systems
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: String
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
The command to run for \fB npm edit\fR and \fB npm config edit\fR .
.SS "\fBlocation\fR"
2021-07-15 20:09:18 +00:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: "user" unless \fB --global\fR is passed, which will also set this value to "global"
.IP \(bu 4
2021-07-15 20:09:18 +00:00
Type: "global", "user", or "project"
2022-12-06 22:18:33 -05:00
.RE 0
2021-07-15 20:09:18 +00:00
.P
2022-12-06 22:18:33 -05:00
When passed to \fB npm config\fR this refers to which config file to use.
2022-05-25 21:26:36 +00:00
.P
2022-12-06 22:18:33 -05:00
When set to "global" mode, packages are installed into the \fB prefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior.
2022-05-25 21:26:36 +00:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
packages are installed into the \fB {prefix}/lib/node_modules\fR folder, instead of the current working directory.
.IP \(bu 4
bin files are linked to \fB {prefix}/bin\fR
.IP \(bu 4
man pages are linked to \fB {prefix}/share/man\fR
.RE 0
2022-05-25 21:26:36 +00:00
2022-12-06 22:18:33 -05:00
.SS "\fBlong\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default: false
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: Boolean
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Show extended information in \fB ls\fR , \fB search\fR , and \fB help-search\fR .
.SS "See Also"
2014-09-24 14:41:07 -07:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-05 14:55:08 -05:00
npm help folders
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help config
2022-12-06 22:18:33 -05:00
.IP \(bu 4
\fB package.json\fR \fI \(la /configuring-npm/package-json\(ra \fR
.IP \(bu 4
2019-11-05 14:55:08 -05:00
npm help npmrc
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2013-07-12 08:55:57 -07:00
npm help npm
2022-12-06 22:18:33 -05:00
.RE 0