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

Add prefer-local semantics and volta use command #509

Open
charlespierce opened this issue Jul 30, 2019 · 1 comment
Open

Add prefer-local semantics and volta use command #509

charlespierce opened this issue Jul 30, 2019 · 1 comment

Comments

@charlespierce
Copy link
Contributor

Related to #502 and from some discussions with @thoov, it would be good to have a flag --prefer-local for volta install, which will attempt to resolve the semver version you are giving with the locally available versions, and only access the internet if that fails.

With that functionality, we should also add a volta use command that exists as an alias of volta install --prefer-local, so the typical use-case of switching between local versions of Node could be easily handled with volta use node@10 and volta use node@8.

@charlespierce
Copy link
Contributor Author

Note: There are some ambiguities around what the user means when they type volta use node@latest: Do they want the latest version overall, or the latest version on their machine? With the --prefer-local flag, the intent seems fairly clear that it would make sense to look for the latest on the machine, but with volta use as an alias, it's less obvious.

From some discussion on Discord, the fact that we will be clearly labelling volta use as an alias for volta install --prefer-local makes it lean towards resolving relative to the user's machine (i.e. volta use node@latest would use the latest node available on the user's local machine) in this case, but an important point is that we need to clearly and explicitly document that behavior, and provide guidance on how to achieve the "latest on the internet" case, so that users who are looking for that behavior can easily find how to achieve their goals.

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

No branches or pull requests

2 participants