You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/lib/content/using-npm/config.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,14 @@ Using `--flag` without specifying any value will set the value to `true`.
20
20
Example: `--flag1 --flag2` will set both configuration parameters to `true`, while `--flag1 --flag2 bar` will set `flag1` to `true`, and `flag2` to `bar`.
21
21
Finally, `--flag1 --flag2 -- bar` will set both configuration parameters to `true`, and the `bar` is taken as a command argument.
22
22
23
+
**Common examples:**
24
+
25
+
*`npm install --prefix /path/to/dir` - Runs npm commands in a different directory without changing the current working directory
*`npm install --save-dev` - Saves to devDependencies (shorthand: `-D`)
28
+
29
+
Any configuration option documented in the [Config Settings](#config-settings) section below can be set via command line flags using `--option-name value` syntax.
30
+
23
31
#### Environment Variables
24
32
25
33
Any environment variables that start with `npm_config_` will be interpreted as a configuration parameter.
0 commit comments