0
votes

I have upgraded to node-12, sqlite3 npm package 4.0.0

When I run it on my desktop (ubuntu 18) it is working fine. However, on cicleci, where I am still using an old container with ubuntu 14, the upgrade to node 12 causes this problem:

$ node --version
v12.2.0
$ node
> const s = require('sqlite3');                                           
Thrown:                                                                    
Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/ubuntu/project/testing/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:800:18)       
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)  
    at require (internal/modules/cjs/helpers.js:16:16)

Does anybody know what this means?

here is an easy way to reproduce it:

$ docker run -it ubuntu:14.04
# apt-get update
# apt-get install curl -y
# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
# source ~/.nvm/nvm.sh
# nvm install 12
# mkdir project
# cd project
# node --version
v12.2.0
# npm install [email protected]
# node
> require('sqlite3');
Thrown:
Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /project/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:800:18)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
1

1 Answers

0
votes

Does anybody know what this means?

It means that your version of node is compiled and linked against a newer version of libstdc++.so.6 that the one available at runtime.

On Linux, you can't expect binaries built on a newer system to run on an older one (but you can expect old binaries to run on a newer system -- that's backwards compatibility).