Open Commandtechno opened 3 years ago
Downgrading to canvas 2.6.1 solves the problem while we don't get it fixed on newest version (2.7.0).
I seem to be getting the same issue, am I doing something wrong?
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/project/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/project/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'
}
[server]$ npm ls canvas
project@1.0.0 /home/username/project
└── canvas@2.6.1
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
:
npx node-pre-gyp rebuild -C ./node_modules/canvas
I'm not sure if there is a way of telling npm to install from source in my package.json
?
any update?
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):
$ strings /lib64/libstdc++.so.6 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_TM_1
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.
I'm not sure if there is a way of telling npm to install from source in my package.json?
It should already be trying to build from source if it can't install a prebuild: https://github.com/Automattic/node-canvas/blob/6bbc8cbd464ff4adc121497fa226d63f1a483f8e/package.json#L32
It should already be trying to build from source if it can't install a prebuild
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 😞
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
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):$ strings /lib64/libstdc++.so.6 | grep CXXABI CXXABI_1.3 CXXABI_1.3.1 CXXABI_1.3.2 CXXABI_1.3.3 CXXABI_1.3.4 CXXABI_1.3.5 CXXABI_1.3.6 CXXABI_1.3.7 CXXABI_TM_1
Is the problem now solved?
this is my solution in Centos7:
yum -y update
yum -y install bzip2 wget gcc gcc-c++ gmp-devel mpfr-devel libmpc-devel
wget https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.gz
tar zxf gcc-8.2.0.tar.gz
cd gcc-8.2.0
./contrib/download_prerequisites
./configure --disable-multilib --enable-languages=c,c++
make -j$(nproc)
make install
libstdc++
Command
find / -name "libstdc++.so.6*"
Output
/usr/local/lib64/libstdc++.so.6
/usr/local/lib64/libstdc++.so.6.0.25
/usr/local/lib64/libstdc++.so.6.0.25-gdb.py
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.py
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyc
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyo
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.19
/usr/lib64/libstdc++.so.6.0.25
/root/gcc-8.2.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6
/root/gcc-8.2.0/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25
/root/gcc-8.2.0/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6
/root/gcc-8.2.0/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25
/root/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6
/root/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25
Command
cp /root/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25 /lib64
rm -f /lib64/libstdc++.so.6
cd /lib64
ln -s /lib64/libstdc++.so.6.0.25 libstdc++.so.6
node-canvas
compilation dependenciesyum install gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel
node-canvas
npm install canvas
npx node-pre-gyp rebuild -C ./node_modules/canvas
Install canvas:2.8.0
successfully.
1.copy and replace all from/node_modules/canvas/build/Release exclude canvas.node,canvas-postbuild.node,obj.target,.deps to /lib64 2.sudo yum install gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel for me it is done.and work.to all my centos server 7 with canvas 2.8.0
@stringang thank you!!! it worked for me
if your os get a problem with all copy .you can copy just libstdc++-6 to /lib64
make -j$(nproc) looping this warning:
/bin/sh ../../libtool --tag CXX --tag disable-shared --mode=compile /DataDisk/demo/gcc-8.2.0/host-x86_64-pc-linux-gnu/gcc/xgcc -shared-libgcc -B/DataDisk/demo/gcc-8.2.0/host-x86_64-pc-linux-gnu/gcc -nostdinc++ -L/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/src -L/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -I/DataDisk/demo/gcc-8.2.0/libstdc++-v3/../libgcc -I/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/include -I/DataDisk/demo/gcc-8.2.0/libstdc++-v3/libsupc++ -prefer-pic -D_GLIBCXX_SHARED -std=gnu++17 -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=ops.lo -g -O2 -D_GNU_SOURCE -c -o ops.lo ../../../.././libstdc++-v3/src/filesystem/ops.cc libtool: compile: /DataDisk/demo/gcc-8.2.0/host-x86_64-pc-linux-gnu/gcc/xgcc -shared-libgcc -B/DataDisk/demo/gcc-8.2.0/host-x86_64-pc-linux-gnu/gcc -nostdinc++ -L/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/src -L/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -I/DataDisk/demo/gcc-8.2.0/libstdc++-v3/../libgcc -I/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/DataDisk/demo/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/include -I/DataDisk/demo/gcc-8.2.0/libstdc++-v3/libsupc++ -D_GLIBCXX_SHARED -std=gnu++17 -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=ops.lo -g -O2 -D_GNU_SOURCE -c ../../../.././libstdc++-v3/src/filesystem/ops.cc -fPIC -DPIC -D_GLIBCXX_SHARED -o ops.o cc1plus: warning: -Wabi won't warn about anything [-Wabi] cc1plus: note: -Wabi warns about differences from the most up-to-date ABI, which is also used by default cc1plus: note: use e.g. -Wabi=11 to warn about changes from GCC 7
In case anyone else is having issues here, this worked for me mostly up until this step:
cp /root/gcc-8.2.0/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25 /lib64
rm -f /lib64/libstdc++.so.6
ln -s /lib64libstdc++.so.6.0.25 libstdc++.so.6
I did not have a copy of the file in /root so I copied from /usr/...then before creating the symbolic link, cd into /lib64 and finally, in the last command, it's missing a slash.
cp /usr/local/lib64/libstdc++.so.6.0.25 /lib64
rm -f /lib64/libstdc++.so.6
cd /lib64
ln -s /lib64/libstdc++.so.6.0.25 libstdc++.so.6
Then the remainder of the commands worked as indicated.
Now I have another issue where the fonts are not being rendered properly and I think I need to add the fonts to the package but not sure how to do that, can anyone help???
@Fooweb updated with my solution.For font issues, see the git repository example
https://github.com/Automattic/node-canvas/blob/master/examples/font.js
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
strings /usr/lib64/libstdc++.so.6|grep CXXABI
if not found CXXABI_1.3.9,update libstdc++.so.6
download libstdc++.so.6.0.26,
copy to /usr/lib64/, and :
cd /usr/lib64/
ln -snf ./libstdc++.so.6.0.26 libstdc++.so.6
Error: /lib64/libc.so.6: version `GLIBC_2.18' not found install GLIBC_2.18:
curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxf glibc-2.18.tar.gz
cd glibc-2.18/
mkdir build
cd build/
./configure --prefix=/usr
make -j2
make install
it works for me
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
strings /usr/lib64/libstdc++.so.6|grep CXXABI
if not found CXXABI_1.3.9,update libstdc++.so.6
download libstdc++.so.6.0.26,
copy to /usr/lib64/, and :
cd /usr/lib64/
ln -snf ./libstdc++.so.6.0.26 libstdc++.so.6
Error: /lib64/libc.so.6: version `GLIBC_2.18' not found install GLIBC_2.18:
curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxf glibc-2.18.tar.gz
cd glibc-2.18/
mkdir build
cd build/
./configure --prefix=/usr
make -j2
make install
it works for me
thanks
thank you
@kroawen you saved my day :) Thank you
Here's my solution:
package.json
inside scripts: {}
"postinstall": "cd ./node_modules/canvas && ../@mapbox/node-pre-gyp/bin/node-pre-gyp install --build-from-source"
scl enable devtoolset-7 -- npm ci
to installNotes:
yum
package managernpm ci
because I use a package-lock.json, but you can run npm install
if you don't Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
strings /usr/lib64/libstdc++.so.6|grep CXXABI
if not found CXXABI_1.3.9,update libstdc++.so.6
download libstdc++.so.6.0.26,
copy to /usr/lib64/, and :
cd /usr/lib64/
ln -snf ./libstdc++.so.6.0.26 libstdc++.so.6
Error: /lib64/libc.so.6: version `GLIBC_2.18' not found install GLIBC_2.18:
curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxf glibc-2.18.tar.gz
cd glibc-2.18/
mkdir build
cd build/
./configure --prefix=/usr
make -j2
make install
it works for me
thanks, I have to change to ../configure --prefix=/usr
Downgrading to canvas 2.6.1 solves the problem while we don't get it fixed on newest version (2.7.0).
not working
i am having issue in make -j$(nproc) make: *** No targets specified and no makefile found. Stop.
⨯ Error: The specified procedure could not be found.
\?\C:\GitHub\snapid-web\node_modules\canvas\build\Release\canvas.node
at Module._extensions..node (node:internal/modules/cjs/loader:1473:18)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at mod.require (C:\GitHub\snapid-web\node_modules\next\dist\server\require-hook.js:64:28)
at require (node:internal/modules/helpers:176:18)
at Object.
./configure --prefix=/usr
Firstly I would like to thank @kroawen for the helpful commands which really can solve the problem on centos 7.x and it seems that there are very small change required as below
tar zxf glibc-2.18.tar.gz => tar -zxf glibc-2.18.tar.gz
./configure --prefix=/usr => ../configure --prefix=/usr
if above can be verified and updated, that could be perfect.
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
Steps to Reproduce
Your Environment
npm list canvas
oryarn list canvas
): canvas@2.7.0ty