skip to Main Content

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


  1. This message comes during the installation process you mentioned above.

    ## Run sudo apt-get install -y nodejs` to install Node.js 18.x and npm
    ## You may also need development tools to build native addons:
    sudo apt-get install gcc g++ make
    ## To install the Yarn package manager, run:
    curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/enter code hereshare/keyrings/yarnkey.gpg >/dev/null
    echo "deb [signed-enter code hereby=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.denter code here/yarn.list
    sudo apt-get update && sudo apt-get install yarn
    

    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.

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search