盖茨比在 mozjpeg 上构建失败

Mar*_*aus 2 linux node.js npm docker gatsby

从昨天开始,我无法将我的 Gatsby 站点部署到我们的服务器,build 抱怨 mozjpeg 库。有没有人遇到过这个错误?

我试过:

  • 锁定 gatsby-cli
  • 添加automakelinux包
  • 添加libtoolslinux包
  • 解冻纱锁
  • 在没有锁定文件的情况下安装依赖项

但似乎没有任何帮助,错误如下:

error /node_modules/mozjpeg: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments:
Directory: /node_modules/mozjpeg
Output:
? spawn /node_modules/mozjpeg/vendor/cjpeg ENOENT
? mozjpeg pre-build test failed
? compiling from source
? Error: Command failed: /bin/sh -c ./configure --enable-static --disable-shared --disable-dependency-tracking --with-jpeg8 --prefix="/node_modules/mozjpeg/vendor" --bindir="/node_modules/mozjpeg/vendor" --libdir="/node_modules/mozjpeg/vendor"
Run Code Online (Sandbox Code Playgroud)

操作系统 Ubuntu 16.04.6 节点 12.14 Gatsby 2.19.7

Fer*_*reu 7

根据一些 GitHub 线程:

他们建议:

  • 安装nasm(强烈推荐)
  • 如果上述解决方案不起作用,请安装automake, autoconf, libtool, dpkg, pkgconfig, libpng, libpng-dev,g++
  • 移除缓存