The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
Change or add a new config option to npm?
How do I add a new config option to the npm CLI?
lib/config/defaults.js, add the option to both the
typesobjects in that file (they’re big and searchable and have configuration you can figure out based on surrounding options).
If it makes sense, add a shorthand for your option in
exports.shorthandsin that file, as well. Generally, this should not be needed.
doc/misc/npm-config.mdand add the option, in alphabetical order, following the formatting for the other options.
If the config option is meant to be a commonly-used flag for a specific command, go to
doc/cli/<command>.mdand add it to the synopsis and/or an “options” section, as you deem appropriate.
Note: for Boolean options, npm automatically handles a
--no- prefix as making that option false. So
--no-package-lock just makes the
package-lock option be