Skip to content

node/npm error: lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found #54

Closed

Description

@gurgunday

It's weird because node 18 works but node 20 doesn't.

OS: Ubuntu 20.04.6

Full error:

/snap/node/7476/bin/node: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /snap/node/7476/bin/node)
/snap/node/7476/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /snap/node/7476/bin/node)
/snap/node/7476/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /snap/node/7476/bin/node)
/snap/node/7476/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /snap/node/7476/bin/node)

Activity

  1. gurgunday commented on May 14, 2023

    @gurgunday
    MemberAuthor

    Installing Node directly fixes the issue, however the issue stands for the snap

  2. rvagg commented on May 15, 2023

    @rvagg
    Member

    Oh, that is interesting .. it's related to the recent update to core22 for the Node.js v20 Snap. I believe what's happening here is that core22 means it's linking into the system libc and libstdc++ rather than the Snap "core" libraries. See my output here: #50 (comment)

    But you're on 20.04, so don't have the 22.04 libraries installed but Snap isn't accounting for that. I'll have to do some research but it could be that core22 means we can't support distros before 22.04, but that seems to break one of the core value propositions of Snaps! There might be a way to force linking into Snap-managed libraries but I'm not sure what that may be.

    If you'd like to help research and figure this out then the help would be appreciated, I'm not sure I'm going to have time to look at this any time soon.

  3. zyv commented on Nov 13, 2023

    @zyv

    @rvagg have you found a solution for Ubuntu 20.04 LTS? We started upgrading our systems to Node 20 snaps and hit this issue. Unless this can be solved in the short term we have to find another solutions. As you say, such problems actually undermine the whole value proposition behind snaps...

  4. mokhosh commented on Jan 8, 2024

    @mokhosh

    Any updates or fixes for this?

  5. aquanjsw commented on Nov 22, 2024

    @aquanjsw

    Use node19 instead, if you don't have version demand...

    sudo snap install node --channel=19/stable --classic
  6. rvagg commented on Aug 25, 2025

    @rvagg
    Member

    I've published and built new node22 snaps using #83 which explicitly (should) include a libstdc++6 in the snap 🤞 ; if anyone's using 22, then would you mind removing (snap remove) and reinstalling it and reporting if this changes anything? If so I'll roll this out to the other lines we're currently supporting.

  7. reopened this on Aug 25, 2025
  8. rvagg commented on Sep 12, 2025

    @rvagg
    Member

    Someone reported this to me earlier in the week that it was still happening on Ubuntu 22.04. I've done some more tweaking, linking the binary into the snap libraries directly, I'd really love for someone to confirm that 22.04 can run the latest node22 or node24 snaps.

  9. peanutsguy commented on Nov 26, 2025

    @peanutsguy

    I'm running Ubuntu 22.04, I'm only able to run up to node23 (including node22). Node24 is throwing the same error for GLIBCXX_3.4.32 and GLIBC_2.38

  10. marcindulak commented on Feb 27, 2026

    @marcindulak

    It's possible to test the various GLIBC incompatibilities in docker, e.g.:

    Start a detached Ubuntu/Debian container (adjust the image):

    docker rm -f node || true
    docker run --name node --rm --detach --privileged --cgroupns=host --tmpfs /run --tmpfs /run/lock -v /sys/fs/cgroup:/sys/fs/cgroup:rw  --device /dev/loop-control --device /dev/loop0 --device /dev/loop1 --device /dev/loop2  ubuntu:22.04 bash -c 'apt update && DEBIAN_FRONTEND=noninteractive apt install -y systemd snapd && exec /lib/systemd/systemd'
    

    or start a RHEL-like Almalinux container:

    docker rm -f node || true
    docker run --name node --rm --detach --privileged --cgroupns=host --tmpfs /run --tmpfs /run/lock -v /sys/fs/cgroup:/sys/fs/cgroup:rw   --device /dev/loop-control --device /dev/loop0 --device /dev/loop1 --device /dev/loop2  almalinux/9-init:9 bash -c 'dnf install -y epel-release && dnf install -y --setopt=install_weak_deps=False snapd && exec /lib/systemd/systemd'
    

    Wait for systemd:

    sleep 240
    docker exec node systemctl is-system-running --wait
    # Expected output: running (not offline)
    

    Failed node 24 installation on ubuntu:22.04:

    docker exec -it node bash -c 'systemctl enable --now snapd.socket && snap wait system seed.loaded && snap remove node && snap install node --channel=24/stable --classic && /snap/bin/node --version'
    snap "node" is not installed
    Warning: /snap/bin was not found in your $PATH. If you've not restarted your session since you
             installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469 for more
             details.
    
    node (24/stable) 24.14.0 from OpenJS Foundation (iojs**) installed
    /snap/node/11265/bin/node: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by /snap/node/11265/bin/node)
    /snap/node/11265/bin/node: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /snap/node/11265/bin/node)
    /snap/node/11265/bin/node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /snap/node/11265/bin/node)
    /snap/node/11265/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/node/11265/bin/node)
    

    Failed node 24 installation on debian:12:

    docker exec -it node bash -c 'systemctl enable --now snapd.socket && snap wait system seed.loaded && snap remove node && snap install node --channel=24/stable --classic && /snap/bin/node --version'
    snap "node" is not installed
    2026-02-27T13:21:09Z INFO Waiting for automatic snapd restart...
    Warning: /snap/bin was not found in your $PATH. If you've not restarted your session since you
             installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469 for more
             details.
    
    node (24/stable) 24.14.0 from OpenJS Foundation (iojs**) installed
    /snap/node/11265/bin/node: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by /snap/node/11265/bin/node)
    /snap/node/11265/bin/node: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /snap/node/11265/bin/node)
    /snap/node/11265/bin/node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /snap/node/11265/bin/node)
    /snap/node/11265/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/node/11265/bin/node)
    

    Failed node 22 installation on almalinux/9:

    docker exec -it node bash -c 'systemctl enable --now snapd.socket && ln -s /var/lib/snapd/snap /snap && snap wait system seed.loaded && snap remove node && snap install node --channel=22/stable --classic && /snap/bin/node --version'
    snap "node" is not installed
    Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you've not restarted your session
             since you installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469
             for more details.
    
    node (22/stable) 22.22.0 from OpenJS Foundation (iojs✓) installed
    /var/lib/snapd/snap/node/11097/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /var/lib/snapd/snap/node/11097/bin/node)
    
  11. bilufe commented on Apr 27, 2026

    @bilufe

    The same error at Ubuntu 22.04!

  12. rvagg commented on Jul 13, 2026

    @rvagg
    Member

    From the 26 track going forward (including edge track), we're pulling the binaries from nodejs.org and bundling those, so it retains the ABI floor established there, with only libatomic.so.1 isolated inside the snap. I believe this and the configuration changes, relying on the host rather than the snap symbols and libaries should address this problem. But for now at least I'm not going to backport this behaviour to older lines, we'll see how it goes for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions