I'm getting this error when running my program:
Error: /lib/x86_64-linux-gnu/libz.so.1: version 'ZLIB_1.2.9' not found ...
Any thoughts?
Hello, this is probably related to the order in which shared libraries are loaded. What other dependencies are you using? Ensure sharp is required before other dependencies that might load a system's zlib first.
I tried rearranging them but I'm getting the same error. I've decided to use a different library that isn't causing conflicts, so I'll close this issue.
Are you able to share the list of other dependencies to help others who may have a similar problem?
I pinpointed the library that was causing conflicts. It was node canvas.
https://github.com/Automattic/node-canvas
Thanks.
See #371, the summary of which is that if you're relying on a system-wide installation of cairo for node-canvas, then the safest option is to also rely on a system-wide install of libvips for sharp.
We have the same issue here.
How to change the setting to let sharp rely on system-wide libvips? Thanks.
@lovell
@kpman http://jcupitt.github.io/libvips/install.html then re-install sharp.
@lovell Thanks for the reply :)
Ran into the same issue with Electron as the _only_ other dependency. I tried a normal npm install but I also tried deleting all my dependencies and manually installing sharp and then electron with a minimal main.js setup. Maybe Electron is loading zlib as part of its bundled Chromium dependency? Here's the quick start repo for Electron that I was trying to reconfigure after my own app wouldn't work: https://github.com/electron/electron-quick-start
Shoveling in the require before electron initiates anything in the main.js or renderer.js file doesn't help, which I kind of expected, but I don't see a clear way around it. Has anyone else worked this out?
@Apophenia Hello, it's interesting that Electron should trigger this also. Perhaps now that it uses node as a shared library rather than a static library then it is exporting zlib symbols? I guess as long as process.versions.zlib is >=1.2.9 then things should be OK.
The latest (beta?) version of Electron appears to use Node 7.9.0, which provides zlib 1.2.11.
$ node -v
v7.9.0
$ node -e "console.log(process.versions.zlib)"
1.2.11
Hi, thanks! I am using sharp 0.18.2, Node v7.9.0, and the Electron v1.7.5 beta and am getting the same console output. I still get the same error as soon as I try to require sharp. If I throw process.versions.zlib into the same place I'm trying to require sharp, it shows 1.2.11.
I'll try stripping down my boilerplate even more just in case I'm missing something obvious, but I seem to be getting the same stack trace whether or not process.noAsar is set to true, and similarly process.versions.zlib seems to equal 1.2.11 regardless of where I print it and what the noAsar setting is. (I have no idea how relevant the noAsar setting is, was just throwing things at the wall since it's in the stack trace.)
ELECTRON_ASAR.js:173 Uncaught Error: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /[path]/electron-quick-start/node_modules/sharp/build/Release/../../vendor/lib/libpng16.so.16)
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> ([path]/electron-quick-start/node_modules/sharp/lib/constructor.js:9:15)
at Object.<anonymous> ([path]/electron-quick-start/node_modules/sharp/lib/constructor.js:234:3)
@Apophenia Thanks for the update and extra info, I've created #892 to track this.
Hi All,
I am using sharp package for quite sometime. Right now I am running my systems on nodejs version 0.12 and it is running fine. It just happened that I wanted to move to node v6.11.2, the latest stable version. After moving to this version, started to get this error:
_module.js:597
return process.dlopen(module, path._makeLong(filename));
^
Error: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /path/to/my/project/node_modules/sharp/build/Release/../../vendor/lib/libpng16.so.16)
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.
I checked the zlib version as well, it looked like 1.2.11
_node -e "console.log(process.versions.zlib)"
1.2.11_
I have not installed any softwares for this purpose. just used the sharp node package only. Is there anything required to be installed on vm?
@manikmi Please see #892.