nvm icon indicating copy to clipboard operation
nvm copied to clipboard

Add nvm_get_arch overwrite

Open MZanggl opened this issue 1 year ago • 9 comments
trafficstars

Addresses https://github.com/nvm-sh/nvm/issues/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 https://github.com/nvm-sh/nvm/issues/3175#issuecomment-1694759072, 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?

MZanggl avatar Dec 20 '23 06:12 MZanggl

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.

MZanggl avatar Jan 17 '24 11:01 MZanggl

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.

ljharb avatar Jan 17 '24 17:01 ljharb

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?

SamFarrington avatar Apr 13 '24 11:04 SamFarrington

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

ljharb avatar Apr 13 '24 22:04 ljharb

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

ljharb avatar Jun 12 '24 12:06 ljharb

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.

MZanggl avatar Jun 13 '24 09:06 MZanggl

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

ljharb avatar Jun 13 '24 23:06 ljharb