We are using Azure Pipelines with build agents using Ubuntu 18.04 as OS.
I am currently trying to update the Nodejs version in our pipelines from 16 to 18. Installation of Nodejs is simple enough by using the NodeTool task from Azure Pipelines with versionSpec: "18.x"
.
However upon using Nodejs afterwards it prompts me for a missing dependency:
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
I can even replicate this behavior using docker with the following instructions
docker pull ubuntu:18.04
docker run -it {IMAGE-ID}
# console switches to TTY session for running container…
apt update
apt install curl
curl -fsSL https://deb.nodesource.com/setup_18.x | bash
apt-get install -y nodejs
# checking the node version generates the error above
node -v
The question here might be a little bit overboard, but I am not used to working with linux systems.
Can i easily resolve this dependency for nodejs?
Or what would be the general approach here to install the missing dependency?
2
Answers
This message comes during the installation process you mentioned above.
I tried that, but still got the same error.
So after a little research it seems that node 18 and ubuntu 18 are not compatible.
https://github.com/nodesource/distributions/issues/1392
If you google the error you will find more about this issue.
Updating to ubuntu 20.04 should fix the problem.
If you don’t need ubuntu for some other reasons than nodejs, I would suggest you try node:18-alpine. (one of the official nodejs images). Alpine is much more lightweigth than ubuntu.
Until the node team fixes this, you can build NodeJS yourself by following https://github.com/nodejs/node/blob/v18.x/BUILDING.md#unix-and-macos with two exceptions:
sudo apt install gcc-8 g++-8
And then while setting up the build:
C=/usr/bin/gcc-8 CXX=/usr/bin/g++-8 ./configure
Credit: https://github.com/nodesource/distributions/issues/1392#issuecomment-1136582618