We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9ff797 commit d8fa9faCopy full SHA for d8fa9fa
docs/content/using-npm/scripts.md
@@ -344,6 +344,11 @@ file.
344
preinstall or install script. If you are doing this, please consider if
345
there is another option. The only valid use of `install` or `preinstall`
346
scripts is for compilation which must be done on the target architecture.
347
+* Scripts are run from the root of the package folder, regardless of what the
348
+ current working directory is when `npm` is invoked. If you want your
349
+ script to use different behavior based on what subdirectory you're in, you
350
+ can use the `INIT_CWD` environment variable, which holds the full path you
351
+ were in when you ran `npm run`.
352
353
### See Also
354
0 commit comments