Skip to content

unable to execute node command on centos 9 stream #82

Closed

Description

@zhanhb
sudo snap install --classic node
# node (22/stable) 22.18.0 from OpenJS Foundation (iojs✓) installed
/var/lib/snapd/snap/bin/node
# /var/lib/snapd/snap/node/10504/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /var/lib/snapd/snap/node/10504/bin/node)
uname -a
# Linux host.example.com 6.1.148-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 15 12:04:10 EDT 2025 x86_64 x86_64 x86_64 GNU/Linux
yum info libstdc++
Installed Packages
Name         : libstdc++
Version      : 11.5.0
Release      : 11.el9
Architecture : x86_64
Size         : 2.5 M
Source       : gcc-11.5.0-11.el9.src.rpm
Repository   : @System
From repo    : baseos
Summary      : GNU Standard C++ Library
URL          : http://gcc.gnu.org
License      : GPLv3+ and GPLv3+ with exceptions and
             : GPLv2+ with exceptions and LGPLv2+ and
             : BSD
Description  : The libstdc++ package contains a
             : rewritten standard compliant GCC
             : Standard C++ Library.

Activity

  1. zhanhb commented on Aug 23, 2025

    @zhanhb
    Author

    It might be simar as #54

  2. rvagg commented on Aug 25, 2025

    @rvagg
    Member

    The library is supposed to come from within the snap, essentially like a container, that's supposed to be one of the benefits of snaps - they are not directly tied to the libraries you have at hand, they come with their own and can be as old or new as will be supported by your kernel. Perhaps we're not properly bundling libstdc++ in the container?

  3. zhanhb commented on Aug 25, 2025

    @zhanhb
    Author

    The libc might be included as well.

    sudo snap install --classic node --channel=24
    # node (24/stable) 24.6.0 from OpenJS Foundation (iojs✓) installed
    /var/lib/snapd/snap/bin/node
    /var/lib/snapd/snap/node/10521/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /var/lib/snapd/snap/node/10521/bin/node)
    /var/lib/snapd/snap/node/10521/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by /var/lib/snapd/snap/node/10521/bin/node)
    /var/lib/snapd/snap/node/10521/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /var/lib/snapd/snap/node/10521/bin/node)
    /var/lib/snapd/snap/node/10521/bin/node: /lib64/libm.so.6: version `GLIBC_2.38' not found (required by /var/lib/snapd/snap/node/10521/bin/node)
    /var/lib/snapd/snap/node/10521/bin/node: /lib64/libc.so.6: version `GLIBC_2.38' not found (required by /var/lib/snapd/snap/node/10521/bin/node)
    
  4. rvagg commented on Aug 25, 2025

    @rvagg
    Member

    See #54 (comment) - uninstall and reinstall and tell me how it goes

  5. rvagg commented on Aug 25, 2025

    @rvagg
    Member

    libc not being available is a bit odder, that should be standard in the core22 container, if this is properly being run within the snap environment then I would expect that being there

  6. zhanhb commented on Aug 25, 2025

    @zhanhb
    Author
    $ /var/lib/snapd/snap/bin/node
    /var/lib/snapd/snap/node/10528/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /var/lib/snapd/snap/node/10528/bin/node)
    $ grep libstdc++ /var/lib/snapd/snap/node/current/snap/manifest.yaml
        - libstdc++6=12.3.0-1ubuntu1~22.04.2
    - libstdc++6=12.3.0-1ubuntu1~22.04.2
    $ ll /var/lib/snapd/snap/node/current/usr/lib/x86_64-linux-gnu/libstdc++.so.6*
    lrwxrwxrwx. 1 root root      19 Jul 15 11:45 /var/lib/snapd/snap/node/current/usr/lib/x86_64-linux-gnu/libstdc++.so.6 -> libstdc++.so.6.0.30
    -rw-r--r--. 1 root root 2260296 Jul 15 11:45 /var/lib/snapd/snap/node/current/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30
    $ ldd /var/lib/snapd/snap/node/current/bin/node 
    /var/lib/snapd/snap/node/current/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /var/lib/snapd/snap/node/current/bin/node)
            linux-vdso.so.1 (0x00007fff36d93000)
            libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007ff02cc00000)
            libm.so.6 => /lib64/libm.so.6 (0x00007ff02ced0000)
            libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ff02ceb3000)
            libc.so.6 => /lib64/libc.so.6 (0x00007ff02c800000)
            /lib64/ld-linux-x86-64.so.2 (0x00007ff0337ea000)
    
  7. rvagg commented on Aug 25, 2025

    @rvagg
    Member

    honestly this seems like it might be to do with the snap install on your system, like it's not wrapping its environment properly before executing I'm not sure what else I can do

  8. zhanhb commented on Aug 26, 2025

    @zhanhb
    Author

    The snapd is installed from repo epel. I'm not sure what can I do with it.

    $ yum info snapd
    Installed Packages
    Name         : snapd
    Version      : 2.70
    Release      : 1.el9
    Architecture : x86_64
    Size         : 66 M
    Source       : snapd-2.70-1.el9.src.rpm
    Repository   : @System
    From repo    : epel
    Summary      : A transactional software package
                 : manager
    URL          : https://github.com/snapcore/snapd
    License      : GPL-3.0-only
    Description  : Snappy is a modern,
                 : cross-distribution, transactional
                 : package manager designed for working
                 : with self-contained, immutable
                 : packages.
    
    
  9. zhanhb commented on Aug 31, 2025

    @zhanhb
    Author

    I found snap curl has a defination in its manifest.yaml

    environment:
          LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/local/lib
    

    The following command helps.

    LD_LIBRARY_PATH=/snap/node/current/usr/lib/x86_64-linux-gnu /snap/bin/node

    The command LD_LIBRARY_PATH=/snap/node/current/usr/lib/x86_64-linux-gnu ldd /snap/node/current/bin/node works as expected as well.

  10. rvagg commented on Sep 1, 2025

    @rvagg
    Member

    yeah, but curl has some stuff going in its non-standard usr/local/lib, we're only using usr/lib which should be standard for a SNAP to include

  11. zhanhb commented on Sep 1, 2025

    @zhanhb
    Author

    https://github.com/canonical/snapcraft/blob/3f076004fa80a8950e624fd8150d3170f435a65b/snapcraft_legacy/internal/meta/_snap_packaging.py#L554-L558

    The confinement of current project is defined as classic, so the environment won't be maintained by snapcraft.

    I'm not sure what is better for this project. Change the confinement or maintain the environment variables manually.

  12. zhanhb commented on Sep 16, 2025

    @zhanhb
    Author

    It might be a solution to set RPATH or RUNPATH to the node elf binary.

    https://github.com/certbot/certbot/blob/867b499f9b3934f88beffe53f021c6834350c2f1/snap/snapcraft.yaml#L127-L129

    $ readelf --dynamic /snap/certbot/current/bin/python3.12 | grep PATH
    0x000000000000000f (RPATH)              Library rpath: [/snap/core24/current/lib/x86_64-linux-gnu]
    
  13. rvagg commented on Sep 17, 2025

    @rvagg
    Member

    @zhanhb if you look at the latest snapscraft.yml you'll see that I'm now doing that, as of last week trying to debug this and related issues. If you try out the latest snap binaries let me know if you still have problems. I tried to get it working for nodeedge, node24 and node22.

  14. zhanhb commented on Sep 17, 2025

    @zhanhb
    Author

    node22:

    $ /snap/bin/node --version
    /var/lib/snapd/snap/node/10595/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /var/lib/snapd/snap/node/10595/bin/node)
    $ ldd /snap/node/current/bin/node
    /snap/node/current/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /snap/node/current/bin/node)
            linux-vdso.so.1 (0x00007ffdd39de000)
            libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f0088000000)
            libm.so.6 => /lib64/libm.so.6 (0x00007f0087f25000)
            libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f00882ad000)
            libc.so.6 => /lib64/libc.so.6 (0x00007f0087c00000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f008eb12000)
    $ readelf --dynamic /snap/node/current/bin/node | grep PATH
     0x000000000000001d (RUNPATH)            Library runpath: [/snap/node/current/lib/:/snap/node/current/usr/lib/:/snap/core22/current/lib/:/snap/core22/current/usr/lib/]
    

    libstdc++.so.6 is located in /snap/core22/current/usr/lib/x86_64-linux-gnu and /snap/node/current/usr/lib/x86_64-linux-gnu. But neither is included in the RUNPATH.

  15. zhanhb commented on Sep 17, 2025

    @zhanhb
    Author

    node24:

    $ node --version
    /var/lib/snapd/snap/node/10590/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /var/lib/snapd/snap/node/10590/bin/node)
    /var/lib/snapd/snap/node/10590/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by /var/lib/snapd/snap/node/10590/bin/node)
    /var/lib/snapd/snap/node/10590/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /var/lib/snapd/snap/node/10590/bin/node)
    /var/lib/snapd/snap/node/10590/bin/node: /lib64/libm.so.6: version `GLIBC_2.38' not found (required by /var/lib/snapd/snap/node/10590/bin/node)
    /var/lib/snapd/snap/node/10590/bin/node: /lib64/libc.so.6: version `GLIBC_2.38' not found (required by /var/lib/snapd/snap/node/10590/bin/node)
    
  16. sxa commented on Feb 24, 2026

    @sxa
    Member

    libc not being available is a bit odder, that should be standard in the core22 container, if this is properly being run within the snap environment then I would expect that being there

    I've just tried the snaps on an Ubuntu 22.04/aarch64 system (Note: I'm not a snap expert so I'm doing something stupid let me know) and am having a similar issue. the Node 14 snap works ok (and is using the libraries from the core snap). Node 22 uses the system libraries ok but the Node 24 appears to be built in a way that is too new for the Ubuntu 22 libraries and doesn't have the dependency on the /snap/core* stuff. Should the recent snaps have a dependency on core to use those libraries instead of the system ones a that seems to have changed since version 14?

    orangepi@orangepi5plus:~$ sudo snap install node --classic --channel=14 && ldd /snap/node/current/bin/node
    node (14/stable) 14.20.1 from OpenJS Foundation (iojs✓) installed
    	linux-vdso.so.1 (0x0000007fa0a52000)
    	libdl.so.2 => /snap/core/current/lib/aarch64-linux-gnu/libdl.so.2 (0x0000007fa0a00000)
    	libstdc++.so.6 => /snap/core/current/usr/lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007fa0870000)
    	libm.so.6 => /snap/core/current/lib/aarch64-linux-gnu/libm.so.6 (0x0000007fa07c0000)
    	libgcc_s.so.1 => /snap/core/current/lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007fa0790000)
    	libpthread.so.0 => /snap/core/current/lib/aarch64-linux-gnu/libpthread.so.0 (0x0000007fa0760000)
    	libc.so.6 => /snap/core/current/lib/aarch64-linux-gnu/libc.so.6 (0x0000007fa0610000)
    	/snap/core/current/lib/ld-linux-aarch64.so.1 => /lib/ld-linux-aarch64.so.1 (0x0000007fa0a19000)
    orangepi@orangepi5plus:~$ sudo snap remove node && sudo snap install node --classic --channel=22 && ldd /snap/node/current/bin/node
    node removed (snap data snapshot saved)
    node (22/stable) 22.22.0 from OpenJS Foundation (iojs✓) installed
    	linux-vdso.so.1 (0x0000007f839ae000)
    	libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007f7d130000)
    	libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007f7d090000)
    	libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007f7d060000)
    	libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007f7ceb0000)
    	/lib/ld-linux-aarch64.so.1 (0x0000007f83975000)
    orangepi@orangepi5plus:~$ sudo snap remove node && sudo snap install node --classic --channel=24 && ldd /snap/node/current/bin/node
    node removed (snap data snapshot saved)
    node (24/stable) 24.13.1 from OpenJS Foundation (iojs✓) installed
    /snap/node/current/bin/node: /lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /snap/node/current/bin/node)
    /snap/node/current/bin/node: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.31' not found (required by /snap/node/current/bin/node)
    /snap/node/current/bin/node: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /snap/node/current/bin/node)
    /snap/node/current/bin/node: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/node/current/bin/node)
    	linux-vdso.so.1 (0x0000007f96491000)
    	libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007f8fd40000)
    	libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007f8fca0000)
    	libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007f8fc70000)
    	libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007f8fac0000)
    	/lib/ld-linux-aarch64.so.1 (0x0000007f96458000)
    orangepi@orangepi5plus:~$ 
    

    (If you're wondering why I picked the somewhat ancient 14 initially it's purely because that's what was referenced in the readme examples :-) )

  17. rvagg commented on Jul 11, 2026

    @rvagg
    Member

    dupe of #54

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