-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: remove npm bin
#5459
Merged
Merged
feat: remove npm bin
#5459
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BREAKING CHANGE: this removes the `npm bin` command The output of this command is misleading and incomplete. The `.bin` resolution of npm is much more nuanced than this command implies, and the output of `npm bin` is not somthing end users should be dealing with. `npm` itself is responsible for running the `bin` entries of modules, with the exception of global bins, which end up in the same folder as `node` itself, presumably already in a user's path since they can run node. Closes npm/statusboard#537
wraithgar
force-pushed
the
gar/remove-bin
branch
from
September 1, 2022 17:45
9c6f26c
to
da6f4f1
Compare
no statistically significant performance changes detected timing results
|
nlf
approved these changes
Sep 7, 2022
flipped to draft while we discuss this |
This was referenced Sep 8, 2022
This was referenced Nov 5, 2022
haines
added a commit
to cerbos/cerbos-sdk-javascript
that referenced
this pull request
Nov 10, 2022
`npm bin` was removed: npm/cli#5459 Signed-off-by: Andrew Haines <[email protected]>
haines
added a commit
to cerbos/cerbos-sdk-javascript
that referenced
this pull request
Nov 10, 2022
`npm bin` was removed: npm/cli#5459 Signed-off-by: Andrew Haines <[email protected]>
haines
added a commit
to cerbos/cerbos-sdk-javascript
that referenced
this pull request
Nov 10, 2022
* chore(deps): update npm to v9 * Run jest using `npm exec` `npm bin` was removed: npm/cli#5459 Signed-off-by: Renovate Bot <[email protected]> Signed-off-by: Andrew Haines <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Andrew Haines <[email protected]>
dch90
pushed a commit
to aws-solutions/media-insights-on-aws
that referenced
this pull request
Feb 8, 2023
Background ========== The build script used `npm bin` to fetch the local bin path for running `cdk` commands. See https://docs.npmjs.com/cli/v8/commands/npm-bin npm version 9 removed the `bin` command so it no longer works. See npm/cli#5459 Change ====== Changed the way the script gets the npm execution environment. Added some clean-up to the script to remove the CloudFormation template staging directory. Updated the "Copy Dist to S3" guard code so it does not try to copy to any of the reference buckets.
colinazn
added a commit
to aws-solutions/media-insights-on-aws
that referenced
this pull request
Feb 14, 2023
Background ========== The build script used `npm bin` to fetch the local bin path for running `cdk` commands. See https://docs.npmjs.com/cli/v8/commands/npm-bin npm version 9 removed the `bin` command so it no longer works. See npm/cli#5459 Change ====== Changed the way the script gets the npm execution environment. Added some clean-up to the script to remove the CloudFormation template staging directory. Updated the "Copy Dist to S3" guard code so it does not try to copy to any of the reference buckets.
douglasnaphas
added a commit
to douglasnaphas/aws-cdk
that referenced
this pull request
Jun 9, 2023
`npm bin` was [removed in npm 9](npm/cli#5459). `npx` or `npm exec` should be used instead. `build.sh` already uses `npm exec`, since aws#24217.
douglasnaphas
added a commit
to douglasnaphas/aws-cdk
that referenced
this pull request
Jun 9, 2023
`npm bin` was [removed in npm 9](npm/cli#5459). `npx` or `npm exec` should be used instead. [This comment](aws#24217 (comment)) on a similar PR, and the discussion on the [PR in npm removing `npm bin`](npm/cli#5459) explain why `npx lerna` is preferable.
mergify bot
pushed a commit
to aws/aws-cdk
that referenced
this pull request
Jun 12, 2023
This change removes the expression `export PATH=$(npm bin):$PATH`, which had formerly been used in scripts to ensure `node_modules` is in `PATH`. `npm bin` was [removed in npm 9](npm/cli#5459). `npm exec` or `npx` should be used instead. `build.sh` already uses `npx`. This change revises `scripts/gen.sh` to use `npx` as well. Prior to this change, within shells executing `build.sh` or `scripts/gen.sh`, `PATH` actually contains error text if npm 9+ is used. ``` ~/repos/aws-cdk $ docker run --rm -v $PWD:$PWD -w $PWD node:hydrogen-alpine sh -c 'node --version && npm --version && export PATH=$(npm bin):$PATH && echo $PATH' # output when npm bin is unavailable v18.16.0 9.5.1 Unknown command: "bin" To see a list of supported npm commands, run: npm help:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ~/repos/aws-cdk $ docker run --rm -v $PWD:$PWD -w $PWD node:gallium-alpine sh -c 'node --version && npm --version && export PATH=$(npm bin):$PATH && echo $PATH' # output when npm bin is available v16.20.0 8.19.4 /Users/douglasnaphas/repos/aws-cdk/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ``` It didn't make `build.sh` fail, because `lerna` has been run via `npx` since #24217, and `build.sh` doesn't need anything from `node_modules` to be added to `PATH`. `export PATH=$(npm bin):$PATH` succeeds even though `npm bin` fails, per `export`'s normal behavior. Prior to this change, `scripts/gen.sh` failed with ``` ./scripts/gen.sh: line 18: lerna: command not found ``` when I ran it. After this change, `scripts/gen.sh` ran successfully. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: this removes the
npm bin
commandThe output of this command is misleading and incomplete. The
.bin
resolution of npm is much more nuanced than this command implies, and
the output of
npm bin
is not something end users should be dealingwith.
npm
itself is responsible for running thebin
entries ofmodules, with the exception of global bins, which end up in the same
folder as
node
itself, presumably already in a user's path since theycan run node.
Closes npm/statusboard#537