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 nvm_get_arch overwrite #3251

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Add nvm_get_arch overwrite #3251

wants to merge 1 commit into from

Conversation

MZanggl
Copy link

@MZanggl MZanggl commented Dec 20, 2023

Addresses #3041

This bypasses the "guess" work for which "architecture" of node.js to use.

It was already possible to specify a custom mirror like mentioned here #3175 (comment), but without the ability to specify the suffix, its use cases are very limited.

One example for this addition is to use Node.js v18+ on centos7 which requires the glibc-217 compatible version. Now possible to install like this
NVM_NODEJS_ORG_MIRROR=https://unofficial-builds.nodejs.org/download/release/ NVM_NODEJS_ORG_ARCH=x64-glibc-217 nvm install 18

Before spending time on adding README, etc. what do you think of this approach?

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the review delay.

Adding a new hook is always dangerous, so I'm going to have to think hard about it. To be clear, the only expected use case here is to use it in combination with unofficial builds?

Either way, to add it, it would indeed need tests and a readme mention, but probably best not to do that work until I'm sure it's something I'd be willing to merge.

@ljharb ljharb marked this pull request as draft January 17, 2024 06:48
@ljharb ljharb added the feature requests I want a new feature in nvm! label Jan 17, 2024
@MZanggl
Copy link
Author

MZanggl commented Jan 17, 2024

I was also hoping this will allow people to use NVM on more niche systems like mentioned in the referenced issue without the need of going through PRs and further expanding the code that determines which architecture to use.

@ljharb
Copy link
Member

ljharb commented Jan 17, 2024

That kind of flexibility is a double-edged sword; i'd rather add new systems explicitly so that it's properly supported versus having a bunch of users with setups I'm totally unaware of, that have a subpar experience.

@SamFarrington
Copy link

Jumped on today to write a PR for this very use case.

Think it's going to become more and more useful as OSs move past glib2.26 and enterprise users are left behind stuck on old gear.

I know Amazon Linux 2 is affected which is quite a big user base.

People, including myself, are doing horrible workarounds, like installing via nvm, then manually(or by script), downloading the unofficial build binaries and overwriting the binary installed by nvm

https://repost.aws/questions/QUvkkhY--uTiSDkS6R1jFnZQ/node-js-18-on-amazon-linux-2
https://repost.aws/questions/QUNO13SFKYS2eiCt3f0lwP4Q/how-to-install-node-js-18-in-amazon-linux-2-ami
https://serverfault.com/questions/1132783/how-can-i-get-node18-on-amazonlinux2

I see this hasn't moved on in 3 months - I'm happy to contribute if I can help get this feature implemented?

@ljharb
Copy link
Member

ljharb commented Apr 13, 2024

@SamFarrington if it's just AWS i'd expect amazon to solve the problem for you.

@ljharb
Copy link
Member

ljharb commented Jun 12, 2024

Instead of the generic escape hatch, is there a more targeted fix specifically for AWS users we could pursue?

@MZanggl
Copy link
Author

MZanggl commented Jun 13, 2024

centos is about to EOL so probably not worth pursuing this at least for the case of just centos.

Users who temporarily need to support Node 18+ before migrating away from centos could just fork or use this nvm branch.

@ljharb
Copy link
Member

ljharb commented Jun 13, 2024

Something being EOL isn't relevant; lots of people are stuck on EOL things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature requests I want a new feature in nvm!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants