我已经升级到 node-12,sqlite3 npm 包 4.0.0
当我在我的桌面(ubuntu 18)上运行它时,它工作正常。但是,在 cicleci 上,我仍在使用带有 ubuntu 14 的旧容器,升级到节点 12 会导致此问题:
$ 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)
有人知道这是什么意思吗?
这是重现它的简单方法:
$ 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 sqlite3@4.0.8
# 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)