Open
Description
I have been trying to get node canvas to work on CentOS 7 yet I keep getting this error that libstdc.6.so version CXXABI 1.3.9 is not found, from checking the version with strings /lib64/libstdc++.so.6 | grep CXXABI
it lists the versions from 1.3 to 1.3.7. I found 1.3 - 1.3.10 in <project directory>/node_modules/canvas/build/Release/libstdc.so.6
. I was wondering if anybody has had similar issues and know a fix, a way to redirect it to use that file (I tried LD_LIBRARY_PATH, but it didn't seem to do anything), or anything that could help. I also have the full console log below if it helps.
Issue or Feature
[server]$ node .
node:internal/modules/cjs/loader:1161
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/username/server/node_modules/canvas/build/Release/canvas.node)
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1161:18)
at Module.load (node:internal/modules/cjs/loader:967:32)
at Function.Module._load (node:internal/modules/cjs/loader:807:14)
at Module.require (node:internal/modules/cjs/loader:991:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/home/username/server/node_modules/canvas/lib/bindings.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1102:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
at Module.load (node:internal/modules/cjs/loader:967:32)
at Function.Module._load (node:internal/modules/cjs/loader:807:14) {
code: 'ERR_DLOPEN_FAILED'
}
Steps to Reproduce
const canvas = require('canvas')
npm i canvas
node .
Your Environment
- Version of node-canvas (output of
npm list canvas
oryarn list canvas
): canvas@2.7.0 - Environment (e.g. node 4.2.0 on Mac OS X 10.8):
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
Activity
wesleimarinho commentedon May 10, 2021
Downgrading to canvas 2.6.1 solves the problem while we don't get it fixed on newest version (2.7.0).
Commandtechno commentedon May 11, 2021
I seem to be getting the same issue, am I doing something wrong?
njh commentedon May 25, 2021
I have also experienced this problem on
CentOS Linux release 7.6.1810 (Core)
.I have worked around this by rebuilding the binary in my project after doing
npm install
:I'm not sure if there is a way of telling npm to install from source in my
package.json
?sinbargit commentedon Jun 3, 2021
any update?
ABValois commentedon Jun 7, 2021
Seems like this problem is a similar to this issue on the VSCode repository (linked because it has loads of great discussion about the cause of the problem). I have spent a few hours today trying to fix this in a docker environment running
CentOS Linux release 7.9.2009 (Core)
and, like in the issue I linked, running the following reveals the missing CXXABI version (note the absence of 1.3.9, added in a version of gcc that CentOS 7 does not include):zbjornson commentedon Jun 7, 2021
I don't think this is something that any of the maintainers have capacity to work on unfortunately (I don't, at least). For Canvas 2.7.0 we had to upgrade the OS used for prebuilds to support the current versions of Node.js, which apparently used a newer CXXABI than CentOS 7 has. Using Canvas 2.6 should work, as should building from source following the steps in the readme.
It should already be trying to build from source if it can't install a prebuild:
node-canvas/package.json
Line 32 in 6bbc8cb
njh commentedon Jun 7, 2021
It does successfully download/install the binary.
But the binary doesn't work because of the ABI issues.
Would be really handy if there was a way of telling it not to use the binary for
node-canvas
and always compile from source, to work around this problem.I am not in a hurry to upgrade to CentOS 8, because it reaches end-of-life before CentOS 7 😞
Gwynbleidd79 commentedon Aug 20, 2021
I'm getting this error too with 2.7.0 and 2.8.0, i can't use 2.6.1 couse node v16.6.1 don't support it
stringang commentedon Sep 14, 2021
Is the problem now solved?
ui: Fix canvas version to 2.6.0 in order to avoid library compatibili…
ui: Fix canvas version to 2.6.0 in order to avoid library compatibili…
ui: Fix canvas version to 2.6.1 in order to avoid library compatibili…
ui: Fix canvas version to 2.6.1 in order to avoid library compatibili…
stringang commentedon Sep 17, 2021
this is my solution in Centos7:
1. Manually upgrade the GCC version
2. Update
libstdc++
Command
Output
Command
3. Installing
node-canvas
compilation dependencies4. Installing
node-canvas
Install
canvas:2.8.0
successfully.20 remaining items