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
[DOCS] --prefix not documented for npm run
, npm install
, etc.
#1368
Comments
npm If your bug is preproducible on If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo Closing: This is an automated message. |
@darcyclarke , This was just a documentation issue that nobody noticed for a full year, so I'm not interesting in re-filing. If you have the power to change the label to Release 7.x, though, that would be great. |
@wraithgar Sir can I work on this ?? |
Prefix is one of those 'core' concepts that doesn't make a lot of sense to call out for every command, but may benefit from mentioning in the full docs. Prefix is mentioned in the If you want to try adding examples to the commands where you think it makes sense start with the .md files that power those pages, for example: https://github.com/npm/cli/blob/latest/docs/content/commands/npm-install.md |
I respectfully disagree. The |
The prefix config can cause all sorts of problems; it’s best if it’s not discoverable. |
@ljharb, If that's the case, then why aren't the problems it can cause also documented? |
Under npm-run-scripts, it says
npm run-script <command> [--silent] [-- <args>...]
, but it doesn't say anything about--prefix
.The only place I've seen so far that mentions
--prefix
is shorthands and other CLI niceties, but this is not likely to be seen, so many developers will not realize the feature exists.I would propose something like this for npm-run-script:
SYNOPSIS
npm run-script <command> [--silent] [--if-present] [--prefix <path>] [--scripts-prepend-node-path | --scripts-prepend-node-path=auto] [-- <args>...]
[...]
Options:
--silent
- prevents npm ERR! from showing in the output on error--if-present
- avoids exiting with a non-zero exit code when the script is undefined, letting potentially undefined scripts to be run without breaking the execution chain--prefix <path>
- forces non-global commands to run in the specified folder, letting scripts contained in other project folders be run without needing to switch to them first (as might occur with a monorepo)--scripts-prepend-node-path
- add the directory within which node resides to the PATH--scripts-prepend-node-path=auto
- only adds the directory to the path if it is not already there (this has been the default since npm v3)The text was updated successfully, but these errors were encountered: