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

[ERROR] Node.js 16 cannot be installed into amazonlinux on docker #1664

Closed
rajeshchinnam opened this issue Sep 21, 2023 · 9 comments · Fixed by newrelic/demo-nodetron#56 or newrelic/demo-simulator#21
Assignees

Comments

@rajeshchinnam
Copy link

Describe your bug

================================================================================

742 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
743 | ================================================================================
744 |  
745 | SCRIPT DEPRECATION WARNING
746 |  
747 |  
748 | This script, located at https://rpm.nodesource.com/setup_X, used to
749 | install Node.js is deprecated now and will eventually be made inactive.
750 |  
751 | Please visit the NodeSource distributions Github and follow the
752 | instructions to migrate your repo.
753 | https://github.com/nodesource/distributions
754 |  
755 | The NodeSource Node.js Linux distributions GitHub repository contains
756 | information about which versions of Node.js and which Linux distributions
757 | are supported and how to install it.
758 | https://github.com/nodesource/distributions
759 |  
760 |  
761 | SCRIPT DEPRECATION WARNING
762 |  
763 | ================================================================================
764 | ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
765 | ================================================================================
766 |  
767 | TO AVOID THIS WAIT MIGRATE THE SCRIPT
768 | Continuing in 60 seconds (press Ctrl-C to abort) ...
769 |  
770 |  
771 | ## Installing the NodeSource Node.js 16.x repo...
772 |  
773 |  
774 | ## Inspecting system...
775 |  
776 | + uname -m
777 | system-release-2-15.amzn2.x86_64
778 | exec redhat-release
779 | Release package: system-release-2-15.amzn2.x86_64
780 |  
781 | ## Confirming "el2-x86_64" is supported...
782 |  
783 | + curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_16.x/el/2/x86_64/nodesource-release-el2-1.noarch.rpm'
784 |  
785 | ## Your distribution, identified as "system-release-2-15.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
786 |  
787 | The command '/bin/sh -c curl -fsSL https://rpm.nodesource.com/setup_16.x | bash - && yum install -y nodejs' returned a non-zero code: 1

Distribution Information:

  • OS: AWS Linux Ubuntu
  • Version 16
  • Docker image , AWS LINUX

Node Version:

  • Node: Node.js v16

To Reproduce
Steps to reproduce the behavior:

  1. Execute Ubuntu Docker Image
  2. Execute Installation instructions for Node.js v16

Expected behavior
Node.js v16 should be installed

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here, specify if already has another NodeJS version or if trying to re-install the current version.

@vasu-winzo
Copy link

I replaced the setup curl with the instructions here and it worked:
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

@bo156
Copy link

bo156 commented Sep 21, 2023

You can also try to use this commands from nodesource documentation
https://github.com/nodesource/distributions#amazon-linux-versions

@mgrozinski
Copy link

Having the same issue. I'm sure there are other methods to install but we've been using the setup_x method over 15 times/week for quite some time and they all started failing today.

In the above result, as well as my own output, it is returning system version as system-release-2-15.amzn2.x86_64, which i do not believe exists. as a result, the script is trying to install the rpm from [2-1] (https://rpm.nodesource.com/pub_16.x/el/2/x86_64/nodesource-release-el2-1.noarch.rpm), an endpoint which does not exist. it is supposed to return system-release-2-14 based on #rpm -q --whatprovides redhat-release , which the script then would point to https://rpm.nodesource.com/pub_16.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm , an endpoint that still works. It was returning that endpoint yesterday for us, as far as I can tell.

PKG_LIST=(
  "redhat-release"
  "centos-release"
  "cloudlinux-release"
  "sl-release"
  "fedora-release"
  "system-release"
  )

for PKG in "${PKG_LIST[@]}"; do
  rpm -q --whatprovides ${PKG}
  if [ $? -eq 0 ]; then
    echo "exec ${PKG}" 
    DISTRO_PKG=$(rpm -q --whatprovides ${PKG})
    echo "Release package: ""${DISTRO_PKG}"
    break
  fi
done
if [[ $DISTRO_PKG =~ ^system-release-2-14 ]]; then

  # Amazon Linux, for 2014.* use el7, older versions are unknown, perhaps el6
  DIST_VERSION=7
RELEASE_URL_VERSION_STRING="${DIST_TYPE}${DIST_VERSION}"
RELEASE_URL="\
https://rpm.nodesource.com/${NODEREPO}/\
${DIST_TYPE}/\
${DIST_VERSION}/\
${DIST_ARCH}/\
nodesource-release-${RELEASE_URL_VERSION_STRING}-1.noarch.rpm"

@sa-snagamine
Copy link

This solution may help
#1663 (comment)

@riosje riosje self-assigned this Sep 22, 2023
@riosje
Copy link
Contributor

riosje commented Sep 22, 2023

Hello guys, please do not use any more the installation scripts.
Just follow the instructions on the readme
https://github.com/nodesource/distributions#nodejs-v16x

sudo yum install https://rpm.nodesource.com/pub_16.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
sudo yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1

@GrahamCampbell
Copy link

This fails for node 18.

image

@riosje
Copy link
Contributor

riosje commented Oct 4, 2023

@GrahamCampbell you can't install node 18 on amazon linux 2
https://github.com/nodesource/distributions#amazon-linux-versions

Amazon linux 2 has glibc2.26 and Node 18 requires at least glibc2.28 you may find an unofficial release which works with amazon linux 2.
https://unofficial-builds.nodejs.org/

@riosje riosje closed this as completed Oct 4, 2023
@GrahamCampbell
Copy link

Thanks for confirming. I figured that was the case, so I guess Amazon have made some code changes to node 18 to get it to build on AL2 for their node18 lambda environment.

@chrislea
Copy link
Contributor

chrislea commented Oct 4, 2023

@GrahamCampbell it has been many years since I've had to deal with any of this, but, historically when this came up (too-old versions of glibc) the workarounds were changes to the compilers that made things work. As opposed to changes to node itself. Just FYI.

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