I'm on an AWS sagemaker instance, and I am trying to install nodejs so I can use CDK to deploy an app. I am using
!curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - !sudo yum install -y nodejs
But when I install I keep getting the error below (tried different versions 14, 16 and 20):
Loaded plugins: dkms-build-requires, extras_suggestions, kernel-livepatch,
: langpacks, priorities, update-motd, versionlock
https://download.docker.com/linux/centos/2/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
neuron | 2.9 kB 00:00
297 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 2:20.12.0-1nodesource will be installed
--> Processing Dependency: glibc >= 2.28 for package: 2:nodejs-20.12.0-1nodesource.x86_64
--> Processing Dependency: libm.so.6(GLIBC_2.27)(64bit) for package: 2:nodejs-20.12.0-1nodesource.x86_64
--> Processing Dependency: libc.so.6(GLIBC_2.28)(64bit) for package: 2:nodejs-20.12.0-1nodesource.x86_64
--> Finished Dependency Resolution
Error: Package: 2:nodejs-20.12.0-1nodesource.x86_64 (nodesource-nodejs)
Requires: libm.so.6(GLIBC_2.27)(64bit)
Error: Package: 2:nodejs-20.12.0-1nodesource.x86_64 (nodesource-nodejs)
Requires: libc.so.6(GLIBC_2.28)(64bit)
Error: Package: 2:nodejs-20.12.0-1nodesource.x86_64 (nodesource-nodejs)
It appears that you are using one of the older container images in SageMaker, which may lead to compatibility issues.
This error typically arises when Node is being installed on an operating system whose GLIBC version does not meet Node's minimum requirements. For example, Node v18 needs GLIBC version 2.7 or newer. Consequently, attempting to install Node v18.x on a Linux OS that is using an older GLIBC version will result in these kind of errors.
To identify the GLIBC version available in your current container, execute the
lddcommand in a terminal.To overcome this issue, consider switching to the new SageMaker Studio experience and use the SageMaker Distribution image. The SageMaker Distribution image not only offers significantly quicker startup times compared to SageMaker Studio Classic but also includes an updated version of GLIBC.
To install Node v18 on the SageMaker Distribution image, you'd only need to run the following:
Alternatively, you also have the option to either create your own custom image that includes a more recent version of Linux and GLIBC or to install Node from source code. However, both approaches may require more effort than using the SageMaker distribution image.