Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): clarify what install type gets .bins #3491

Merged
merged 1 commit into from Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/content/configuring-npm/folders.md
Expand Up @@ -45,14 +45,16 @@ Global installs on Windows go to `{prefix}/node_modules` (that is, no
Scoped packages are installed the same way, except they are grouped together
in a sub-folder of the relevant `node_modules` folder with the name of that
scope prefix by the @ symbol, e.g. `npm install @myorg/package` would place
the package in `{prefix}/node_modules/@myorg/package`. See [`scope`](/using-npm/scope) for more details.
the package in `{prefix}/node_modules/@myorg/package`. See
[`scope`](/using-npm/scope) for more details.

If you wish to `require()` a package, then install it locally.

#### Executables

When in global mode, executables are linked into `{prefix}/bin` on Unix,
or directly into `{prefix}` on Windows.
or directly into `{prefix}` on Windows. Ensure that path is in your
terminal's `PATH` environment to run them.

When in local mode, executables are linked into
`./node_modules/.bin` so that they can be made available to scripts run
Expand Down
12 changes: 9 additions & 3 deletions docs/content/configuring-npm/package-json.md
Expand Up @@ -341,9 +341,12 @@ install into the PATH. npm makes this pretty easy (in fact, it uses this
feature to install the "npm" executable.)

To use this, supply a `bin` field in your package.json which is a map of
command name to local file name. On install, npm will symlink that file
into `prefix/bin` for global installs, or `./node_modules/.bin/` for local
installs.
command name to local file name. When this package is installed
globally, that file will be linked where global bins go so it is
available to run by name. When this package is installed as a
dependency in another package, the file will be linked where it will be
available to that package either directly by `npm exec` or by name in other
scripts when invoking them via `npm run-script`.


For example, myapp could have this:
Expand Down Expand Up @@ -388,6 +391,9 @@ executable!

Note that you can also set the executable files using [directories.bin](#directoriesbin).

See [folders](/configuring-npm/folders#executables) for more info on
executables.

### man

Specify either a single file or an array of filenames to put in place for
Expand Down