Phantomjs 无法安装:自动配置错误



当尝试在Ubuntu 22.04上安装Phantomjs时,我得到以下错误:有一些问题。从2015年到2022年,我尝试了所有的建议。

https://github.com/ariya/phantomjs/issues/10904

https://gist.github.com/julionc/7476620

wkhtmltopdf - libfontconfig.so。1:无法打开共享对象文件

http://ubuntuhowtoo.blogspot.com/2019/05/linux-nodejs-phantomjs-error-loading.html

Auto configuration failed
139998593603520:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libproviders.so): libproviders.so: cannot open shared object file: No such file or directory
139998593603520:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139998593603520:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=providers, path=providers
139998593603520:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=providers```

我有同样的问题,并通过在使用phantomJS之前设置export OPENSSL_CONF=/dev/null来修复它。如果你不可能禁用openssl,那么你就必须使用旧版本的openssl来打包你的应用程序。

解释:Ubuntu 22.04使用新的OpenSSL 3.0.2版本,而不是旧的OpenSSL 1.1.1版本。这些OpenSSL版本不完全兼容,所以这就是为什么当PhantomJS试图自动配置SSL/TLS设置时你会看到这个错误。

以上答案与我所描述的相差无几。

步骤:1首先停止节点服务器,然后在基本目录下运行此命令。

步骤:2我建议您注释掉文件/etc/ssl/openssl.cnf

步骤:3启动应用程序

短暂ref. https://github.com/nodejs/node/issues/43132

最新更新