fix(docs): clarify what install type gets .bins · npm/cli@339145f (original) (raw)
File tree
2 files changed
lines changed
- docs/content/configuring-npm
2 files changed
lines changed
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -45,14 +45,16 @@ Global installs on Windows go to `{prefix}/node_modules` (that is, no | ||
| 45 | 45 | Scoped packages are installed the same way, except they are grouped together |
| 46 | 46 | in a sub-folder of the relevant `node_modules` folder with the name of that |
| 47 | 47 | scope prefix by the @ symbol, e.g. `npm install @myorg/package` would place |
| 48 | -the package in `{prefix}/node_modules/@myorg/package`. See [`scope`](/using-npm/scope) for more details. | |
| 48 | +the package in `{prefix}/node_modules/@myorg/package`. See | |
| 49 | +[`scope`](/using-npm/scope) for more details. | |
| 49 | 50 | |
| 50 | 51 | If you wish to `require()` a package, then install it locally. |
| 51 | 52 | |
| 52 | 53 | #### Executables |
| 53 | 54 | |
| 54 | 55 | When in global mode, executables are linked into `{prefix}/bin` on Unix, |
| 55 | -or directly into `{prefix}` on Windows. | |
| 56 | +or directly into `{prefix}` on Windows. Ensure that path is in your | |
| 57 | +terminal's `PATH` environment to run them. | |
| 56 | 58 | |
| 57 | 59 | When in local mode, executables are linked into |
| 58 | 60 | `./node_modules/.bin` so that they can be made available to scripts run |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -341,9 +341,12 @@ install into the PATH. npm makes this pretty easy (in fact, it uses this | ||
| 341 | 341 | feature to install the "npm" executable.) |
| 342 | 342 | |
| 343 | 343 | To use this, supply a `bin` field in your package.json which is a map of |
| 344 | -command name to local file name. On install, npm will symlink that file | |
| 345 | -into `prefix/bin` for global installs, or `./node_modules/.bin/` for local | |
| 346 | -installs. | |
| 344 | +command name to local file name. When this package is installed | |
| 345 | +globally, that file will be linked where global bins go so it is | |
| 346 | +available to run by name. When this package is installed as a | |
| 347 | +dependency in another package, the file will be linked where it will be | |
| 348 | +available to that package either directly by `npm exec` or by name in other | |
| 349 | +scripts when invoking them via `npm run-script`. | |
| 347 | 350 | |
| 348 | 351 | |
| 349 | 352 | For example, myapp could have this: |
| @@ -388,6 +391,9 @@ executable! | ||
| 388 | 391 | |
| 389 | 392 | Note that you can also set the executable files using [directories.bin](#directoriesbin). |
| 390 | 393 | |
| 394 | +See [folders](/configuring-npm/folders#executables) for more info on | |
| 395 | +executables. | |
| 396 | + | |
| 391 | 397 | ### man |
| 392 | 398 | |
| 393 | 399 | Specify either a single file or an array of filenames to put in place for |