nodesource / distributions

NodeSource Node.js Binary Distributions
https://nodesource.com
MIT License
13.41k stars 3.07k forks source link

[ERROR] Node.js 8/10 on Amazon Linux 2 Installation fail #1805

Closed nitrogear closed 2 weeks ago

nitrogear commented 3 months ago

Describe your bug Due to some internal legacy, I need to install NodeJs 8/10) on Amazon Linux 2.

Distribution Information:

**Node Version: 8.x/10.x

To Reproduce Steps to reproduce the behavior:

Script https://rpm.nodesource.com/setup_8.x or https://rpm.nodesource.com/setup_10.x fails with error:

## Inspecting system...

+ uname -m
system-release-2-16.amzn2.x86_64
exec redhat-release
Release package: system-release-2-16.amzn2.x86_64

## Confirming "el2-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_8.x/el/2/x86_64/nodesource-release-el2-1.noarch.rpm'

## Your distribution, identified as "system-release-2-16.amzn2.x86_64", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support

Expected behavior On AMI ID ami-089e242cca5620377 installation is successful

Additional context The issue is in detecting the version of Amazon Linux. Here is the patch to fix it:

--- setup_8.sh  2024-06-08 09:58:10.826373283 +0000
+++ setup_fix8.sh   2024-06-08 10:02:15.175487116 +0000
@@ -296,7 +296,7 @@

 fi

-if [[ $DISTRO_PKG =~ ^system-release-2-14 ]]; then
+if [[ $DISTRO_PKG =~ ^system-release-2-(14|16) ]]; then

   # Amazon Linux, for 2014.* use el7, older versions are unknown, perhaps el6
   DIST_VERSION=7
JesusPaz commented 2 months ago

Hi, we do not support node v8 or v10. I can check in our old packages and give you some instructions on how to install those versions. What are the specific versions you need?