Skip to content
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

Access to the binaries without global install #44

Closed
aduh95 opened this issue Aug 1, 2021 · 3 comments · Fixed by #47 or #58
Closed

Access to the binaries without global install #44

aduh95 opened this issue Aug 1, 2021 · 3 comments · Fixed by #47 or #58

Comments

@aduh95
Copy link
Contributor

aduh95 commented Aug 1, 2021

I wonder if it would be possible to have a feature similar to python -m pip to access the package manager binaries without having them on the path. It would be useful in case the binary name clashes with another program. That could potentially address the concern of "How Corepack scales if there's 1000 package managers added to it, each package manager adding 100 binaries to the path?".

The API could look something like:

> corepack yarn install

wdyt?

@arcanis
Copy link
Contributor

arcanis commented Aug 1, 2021

It's already possible, except that you need to make the package manager name explicit, like this:

corepack yarn[@x.y.z] yarn install

Making it optional shouldn't be too difficult though 🤔

@aduh95
Copy link
Contributor Author

aduh95 commented Aug 1, 2021

I suppose the reason for requiring to repeat the name of the package manager is to support package managers with several binaries, right? Considering that most package managers use only one binary – or use several binaries as a shortcut for a command available in the "main" one (such as npx <~> npm exec), I think it would make sense to drop this requirement. (Unless it may break something somewhere, in that case, it's certainly not worth the risk of breakage).

@arcanis
Copy link
Contributor

arcanis commented Aug 1, 2021

I think dropping the requirement is a good idea 👍 it's more that corepack <pkg manager> <binary> was a bit of an implementation detail so I didn't look too deep into its API, but it certainly makes sense. I'll make a PR to simplify that, and add it to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants