If multiple single-character shorthands are strung together, and the If the specified configuration param resolves unambiguously to a knownĬonfiguration parameter, then it is expanded to that configuration The following shorthands are parsed on the command-line: Internal to npm, and are defaults if nothing else is specified. Run npm config ls -l to see a set of configuration parameters that are npm's built-in configuration file ( /path/to/npm/npmrc).global configuration file (defaults to $PREFIX/etc/npmrc configurable viaĬLI option -globalconfig or environment variable $NPM_CONFIG_GLOBALCONFIG).Option -userconfig or environment variable $NPM_CONFIG_USERCONFIG) per-user configuration file (defaults to $HOME/.npmrc configurable via CLI.per-project configuration file ( /path/to/my/project/.npmrc).Would become npm_config_allow_same_version=true. Notice that you need to use underscores instead of dashes, so -allow-same-version Those lowercase versions over any uppercase ones that you might set. Npm will set its own environment variables and Node will prefer However, please note that inside npm-scripts Values are case-insensitive, so NPM_CONFIG_FOO=bar will work the Any environment configurations thatĪre not given a value will be given the value of true. Npm_config_foo=bar in your environment will set the fooĬonfiguration parameter to bar. Interpreted as a configuration parameter. Environment VariablesĪny environment variables that start with npm_config_ will be Finally, -flag1 -flag2 - bar will setīoth configuration parameters to true, and the bar is takenĪs a command argument. To true, while -flag1 -flag2 bar will set flag1 to true,Īnd flag2 to bar. Using -flag without specifying any value will setĮxample: -flag1 -flag2 will set both configuration parameters A - argument tells the cli parser to stop Putting -foo bar on the command line sets the foo configuration Npm gets its configuration values from the following sources, sorted by priority: Command Line Flags Npm-config More than you probably want to know about npm configuration Description
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |