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

Make a link to install latest version? #3359

Closed
birgersp opened this issue May 22, 2024 · 8 comments
Closed

Make a link to install latest version? #3359

birgersp opened this issue May 22, 2024 · 8 comments

Comments

@birgersp
Copy link

I have script(s) installing nvm. And I'd like to just install the latest version.

Please consider making a url (somewhere) that would always point to the latest version of nvm.

E.g. this install command could be

curl -o- https://nvm.org/install.sh | bash
@ljharb
Copy link
Member

ljharb commented May 22, 2024

That would be blindly updating across breaking changes, and would be a terrible idea.

Duplicate of #400.

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
@birgersp
Copy link
Author

Just realised I can use this link:

https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh

@ljharb
Copy link
Member

ljharb commented May 22, 2024

Nope, because master is often broken. Only tagged releases are safe to use.

@emilfihlman
Copy link

@ljharb there are other use cases, like using cloud-init.

Please consider updating the release asset name to a well known sticky one, or at least providing another asset that always has a fixed name, like nvm.zip, so https://github.com/nvm-sh/nvm/releases/latest/download/nvm.zip could be used for automating installs with cloud-init. You can have the zip contents reflect on version if you wish.

@emilfihlman
Copy link

emilfihlman commented Jul 26, 2024

Even better would be just to include the install.sh in the releases.

But in the mean time, here is a very hacky solution to getting the latest install script that doesn't rely on magic version numbers or creation of temporary files etc

curl -sL "$(curl -sL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r .zipball_url)" | busybox unzip -p - '*/install.sh' > nvm_install.sh

This should be quite easy to adapt to directly executing and installing the latest release node

@ljharb
Copy link
Member

ljharb commented Jul 26, 2024

@emilfihlman your use case still has the problem that breaking changes will be silently installed, risking breaking your workflow. The proper solution is to always hardcode a version number or semver range.

@emilfihlman
Copy link

@ljharb I think it's not for this package to be concerned about that.

The proper solution is definitely to not hardcore version numbers. That is the most awful thing to do.

@ljharb
Copy link
Member

ljharb commented Jul 26, 2024

@emilfihlman it is absolutely for nvm to be concerned about circumstances that could cause nvm users to have a broken experience.

Why is that the most awful thing to do? That's literally the universal consensus on all forms of dependencies in the entire security and tech ecosystem (too much, imo, even)

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

No branches or pull requests

3 participants