-
Notifications
You must be signed in to change notification settings - Fork 58
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
BREAKING CHANGE(bin): remove command #537
Comments
Why is this being removed? |
This PR removes `npm bin` in favor of a custom implementation since the command will be removed in npm 9. - Related to npm/statusboard#537
In global mode, |
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
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
If the command is going to be removed, it would be great if the algorithm itself was documented. |
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 something 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
(Posting here for visibility.) There is a discussion at npm/feedback#807 to find an alternative for a use case broken by this change. |
If |
Looks like |
@nmccready that's what |
Thank you I will look into this. |
There's a lot of discussion of
Surely the global install path should be in your $PATH variable, right? This was one thing |
The global install path should already be in your path because that is where node itself is. npm is installed into a given version of node alongside the node binary, the assumption being that if you can run node, npm can link bins into the same directory to have them also available to the end user without an extra The nuance here comes from the fact that Windows installs node/npm into a different directory structure than osx and linux. There is no The So for instance in fish shell this would be a more appropriate way of knowing where those bins lived $ dirname (which node)
/Users/wraithgar/.nvm/versions/node/v18.12.0/bin They really have nothing to do with npm, but with node itself. |
In the Windows Node installer, it's more than just the different directory structure, the global packages are installed in a completely separate directory from the node installation. Being able to run
With a clean install of node on Windows with these two features selected, it will add two separate locations to the PATH:
This is because of the value of
If I then install a package (ex: This all works seamlessly in the ideal case, but speaking as someone that handles troubleshooting for a large population of developers that are not always primarily doing Node/npm/JS development, incomplete or inaccurate PATH variables have been an uncommon yet consistent issue. It was useful for us to have Given the nature of Windows' two-location installation, this does seem like a Windows-only problem. As such, I'm not sure what the cleanest fix would be. For this use case we do not need any of the "non-global" functionality of |
This is very good feedback @molisani thank you for laying it out so clearly. Can you open a new issue in https://github.com/npm/rfcs suggesting we reintroduce a global only bin command? Your last comment can be copy/pasted there as a starting point I think. This closed issue definitely has no greater visibility w/in the org so discussion here is unlikely to result in any npm change. |
Use npx instead of npm bin npm/statusboard#537
Use npx instead of npm bin npm/statusboard#537
`npm bin` has been removed. npm/statusboard#537
No description provided.
The text was updated successfully, but these errors were encountered: