diff options
author | Matt Brennan <mattyb1000@gmail.com> | 2015-03-04 20:58:26 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-03-05 12:40:07 +0300 |
commit | c9bd58dd637b9c41441023584a13e3818d5db336 (patch) | |
tree | 2877533cb158056f63ae6efa55323d51a07f2744 | |
parent | 1226ca98d4d7650cc3ba16bf7ac62e44820f3bfa (diff) |
doc: add note about node_modules/.bin
-rw-r--r-- | doc/cli/npm-run-script.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/cli/npm-run-script.md b/doc/cli/npm-run-script.md index 9e6e17e1d..487bd5942 100644 --- a/doc/cli/npm-run-script.md +++ b/doc/cli/npm-run-script.md @@ -29,6 +29,13 @@ environment variables that will be available to the script at runtime. If an "env" command is defined in your package it will take precedence over the built-in. +In addition to the shell's pre-existing `PATH`, `npm run` adds +`node_modules/.bin` to the `PATH` provided to scripts. Any binaries provided by +locally-installed dependencies can be used without the `node_modules/.bin` +prefix. For example, if there is a `devDependency` on `tap` in your package, +you should write `"scripts": {"test": "tap test/\*.js"}` instead of `"scripts": +{"test": "node_modules/.bin/tap test/\*.js"}` to run your tests. + ## SEE ALSO * npm-scripts(7) |