【问题标题】:error pngquant-bin with npm install使用 npm install 错误 pngquant-bin
【发布时间】:2018-07-16 14:28:00
【问题描述】:

我安装 npm 并且在出现此错误之前一切正常,我试图找出导致此问题的原因但没有成功。安装后,我尝试运行“npm run dev”,但也出现错误。我猜是因为 npm install 的问题。我尝试安装模块 pngquant-bin 但也没有成功。

如果您知道方法或者您已经面临同样的问题,请帮助我。我看到了关于它的其他问题,但有任何回应。请。

pngquant-bin@4.0.0 安装后 /var/www/html/futebit/node_modules/pngquant-bin 节点库/install.js

  ⚠ The `/var/www/html/futebit/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant pre-build test passed successfully
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installed
    at Promise.all.then.arr (/var/www/html/futebit/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pngquant-bin@4.0.0 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pngquant-bin@4.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-07-16T14_17_27_195Z-debug.log

【问题讨论】:

    标签: node.js npm pngquant


    【解决方案1】:

    Pngquant 需要 vcruntime140.dll。 从https://www.microsoft.com/en-in/download/details.aspx?id=48145下载并安装适用于 Visual Studio 2015 的 64 位和 32 位 Visual C++ Redistributable

    【讨论】:

      【解决方案2】:

      错误状态为make sure that libpng-dev is installed。这意味着您可能缺少该软件包。

      在 Debian/Ubuntu 上,您可以使用 sudo apt install libpng-dev 修复它。这对我有用。

      【讨论】:

      • 这没有提供问题的答案。要批评或要求作者澄清,请在他们的帖子下方留下评论。 - From Review
      • 好的,我更新了答案,希望现在符合规则
      【解决方案3】:

      您似乎正在尝试使用预编译的二进制文件pngquant-bin,但由于操作系统中使用的库不兼容而失败,因此有两种使用方法:

      1. 在节点包之外安装系统范围的pngquant

      2. 如果您使用的是旧操作系统,请尝试升级库,然后再次安装节点包

      3. 如果您有最新的操作系统,请尝试将节点包也升级到最新版本。

      【讨论】:

        猜你喜欢
        • 2017-03-24
        • 2016-12-30
        • 2020-07-16
        • 2016-01-03
        • 2018-02-11
        • 1970-01-01
        • 1970-01-01
        • 2019-09-30
        相关资源
        最近更新 更多