V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
s609926202
V2EX  ›  问与答

快被 gulp-image 这个包给整疯了,有用过的来看看?

  •  
  •   s609926202 · 2018-08-23 13:31:07 +08:00 · 1713 次点击
    这是一个创建于 2066 天前的主题,其中的信息可能已经有所发展或是发生改变。

    系统:centos7.2 报错信息如下:

    [13:28:40] 'images' errored after 72 ms
    [13:28:40] Error in plugin "gulp-image"
    Message:
        Command failed: /home/wwwroot/trueniu-php/wp-content/themes/trueniu_base/node_modules/mozjpeg/vendor/cjpeg -optimize -progressive -outfile /tmp/ea377731-efbb-445e-8d82-b84b6b561e54 /tmp/ad053805-5064-43dc-8da2-93e69a3cd529
    /home/wwwroot/trueniu-php/wp-content/themes/trueniu_base/node_modules/mozjpeg/vendor/cjpeg: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory
    
    
    Details:
        code: 127
        killed: false
        stdout: 
        stderr: /home/wwwroot/trueniu-php/wp-content/themes/trueniu_base/node_modules/mozjpeg/vendor/cjpeg: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory
    
        failed: true
        signal: null
        cmd: /home/wwwroot/trueniu-php/wp-content/themes/trueniu_base/node_modules/mozjpeg/vendor/cjpeg -optimize -progressive -outfile /tmp/ea377731-efbb-445e-8d82-b84b6b561e54 /tmp/ad053805-5064-43dc-8da2-93e69a3cd529
        timedOut: false
        domainEmitter: [object Object]
        domain: [object Object]
        domainThrown: false
    
    第 1 条附言  ·  2018-08-23 14:52:07 +08:00
    解决了,,

    之前用的这样的编译安装 libpng16:
    ./configure -prefix=/usr/local/libpng16
    make check
    make install
    ldconfig

    用了这样的方式后好了:
    ./configure
    make check
    make install
    ldconfig

    显然指定目录后还需要做软连接,但是我实在不知道往哪里链接,,只能默认./configure 这样了,,
    5 条回复    2018-08-23 15:04:54 +08:00
    zbinlin
        2
    zbinlin  
       2018-08-23 14:27:52 +08:00
    明显是依赖库未安装:

    ```sh
    yum install -y libjpeg libpng
    ```

    https://www.npmjs.com/package/gulp-image#user-content-external-dendencies
    s609926202
        3
    s609926202  
    OP
       2018-08-23 14:35:48 +08:00
    @zbinlin 确实已经安装了、、

    软件包 libjpeg-turbo-1.2.90-5.el7.x86_64 已安装并且是最新版本
    软件包 2:libpng-1.5.13-7.el7_2.x86_64 已安装并且是最新版本
    s609926202
        4
    s609926202  
    OP
       2018-08-23 14:45:04 +08:00
    @yangg 这些都搜过了,现在是即使安装了这个 libpng16.so ,还是提示这样,,哎,,
    zbinlin
        5
    zbinlin  
       2018-08-23 15:04:54 +08:00
    版本问题,我看了下 centos 默认的 libpng, 和 libpng-devel 是 1.5 的,所以只有 libpng15.so ,没有 libpng16.so
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2813 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 02:25 · PVG 10:25 · LAX 19:25 · JFK 22:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.