Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/lib/content/using-npm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ Using `--flag` without specifying any value will set the value to `true`.
Example: `--flag1 --flag2` will set both configuration parameters to `true`, while `--flag1 --flag2 bar` will set `flag1` to `true`, and `flag2` to `bar`.
Finally, `--flag1 --flag2 -- bar` will set both configuration parameters to `true`, and the `bar` is taken as a command argument.

**Common examples:**

* `npm install --prefix /path/to/dir` - Runs npm commands in a different directory without changing the current working directory
* `npm install --global` - Installs packages globally (shorthand: `-g`)
* `npm install --save-dev` - Saves to devDependencies (shorthand: `-D`)

Any configuration option documented in the [Config Settings](#config-settings) section below can be set via command line flags using `--option-name value` syntax.

#### Environment Variables

Any environment variables that start with `npm_config_` will be interpreted as a configuration parameter.
Expand Down
Loading