nodegit: Cannot install nodegit on linux machines (e.g. travis builds)

/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/travis/build/runspired/ember-cli-changelog/node_modules/nodegit/build/Release/nodegit.node)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (5 by maintainers)

Commits related to this issue

Most upvoted comments

we are also hitting same issue

Error: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20’ not found (required by /data/jenkins/workspace/master/node_modules/nodegit/build/Release/nodegit.node)

Is there any solution for centos-release-6-7 OS?

We’re still linking our prebuilts to a newer gcc. If you build it from source it should work fine. Try:

BUILD_ONLY=true npm install nodegit

Is there any solution for centos-release-6-7 OS?

BUILD_ONLY=true npm install nodegit solved the problem for me on centos7. Thanks to https://github.com/nodegit/nodegit/issues/853#issuecomment-169240445

You can do this in Travis-CI by adding the following to your .travis.yml file:

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - libstdc++-4.9-dev

I received this error myself when installing NodeGit on Ubuntu. So I followed my own advice above and installed both GCC 4.9 and the libstdc+±4.9-dev packages by doing:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libstdc++-4.9-dev

Pre install libstdc+±4.9-dev linked libraries:

λ ldd node_modules/nodegit/build/Release/nodegit.node
node_modules/nodegit/build/Release/nodegit.node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node_modules/nodegit/build/Release/nodegit.node)
    linux-vdso.so.1 =>  (0x00007fffdabd5000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7309f02000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7309cec000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7309ace000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7309709000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7309403000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f730ad03000)

Post install libstdc+±4.9-dev linked libraries:

λ ldd node_modules/nodegit/build/Release/nodegit.node 
    linux-vdso.so.1 =>  (0x00007ffe26c6a000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4d5b9ea000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4d5b7cc000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4d5b407000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4d5b101000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f4d5c46a000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4d5aeeb000)

So yes, you’ll definitely need to install libstdc+±4.9-dev if it’s not working out-of-the-box.