Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions docs/lib/content/commands/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ In particular, npm has two modes of operation:
npm installs packages into the current project directory, which defaults to the current working directory.
Packages install to `./node_modules`, and bins to `./node_modules/.bin`.
* global mode:
npm installs packages into the install prefix at `$npm_config_prefix/lib/node_modules` and bins to `$npm_config_prefix/bin`.
npm installs packages into the install prefix at `$NPM_CONFIG_PREFIX/lib/node_modules` and bins to `$NPM_CONFIG_PREFIX/bin`.

Local mode is the default.
Use `-g` or `--global` on any command to run in global mode instead.
Expand Down Expand Up @@ -94,8 +94,8 @@ It reads its configuration options from 5 places.
All keys take a value, even if they are booleans (the config parser doesn't know what the options are at the time of parsing).
If you do not provide a value (`--key`) then the option is set to boolean `true`.
* Environment Variables:
Set any config by prefixing the name in an environment variable with `npm_config_`.
For example, `export npm_config_key=val`.
Set any config by prefixing the name in an environment variable with `NPM_CONFIG_`.
For example, `export NPM_CONFIG_KEY=val`.
* User Configs:
The file at `$HOME/.npmrc` is an ini-formatted list of configs.
If present, it is parsed.
Expand Down
2 changes: 1 addition & 1 deletion docs/lib/content/using-npm/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ They just have to be some kind of executable file.
Read through [`package.json`](/configuring-npm/package-json) to see all the things that you can specify and enable by simply describing your package appropriately.
In general, this will lead to a more robust and consistent state.
* Inspect the env to determine where to put things.
For instance, if the `npm_config_binroot` environment variable is set to `/home/user/bin`, then don't try to install executables into `/usr/local/bin`.
For instance, if the `NPM_CONFIG_BINROOT` environment variable is set to `/home/user/bin`, then don't try to install executables into `/usr/local/bin`.
The user probably set it up that way for a reason.
* Don't prefix your script commands with "sudo". If root permissions are required for some reason, then it'll fail with that error, and the user will sudo the npm command in question.
* Don't use `install`.
Expand Down
Loading