盖茨比在mozjpeg上构建失败

问题描述:

从昨天开始,我无法将我的Gatsby站点部署到我们的服务器,内部版本抱怨mozjpeg库.有人遇到过此错误吗?

From yesterday I am unable to deploy my Gatsby site to our server, build is complaining about mozjpeg library. Have anyone encountered this error before?

我尝试过:

  • 锁定gatsby-cli
  • 添加 automake linux软件包
  • 添加 libtools linux软件包
  • 解冻纱线锁
  • 在没有锁定文件的情况下安装依赖项
  • locking gatsby-cli
  • adding automake linux package
  • adding libtools linux package
  • unfreezing yarn lock
  • installing dependencies without lock file

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

But nothing seemed to help, the error is as follows:

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"

操作系统Ubuntu 16.04.6节点12.14盖茨比2.19.7

OS Ubuntu 16.04.6 Node 12.14 Gatsby 2.19.7

根据一些GitHub线程:

According to some GitHub threads:

他们建议:

  • 安装 nasm (强烈建议)
  • 如果上述解决方案无效,请安装 automake autoconf libtool dpkg pkgconfig libpng libpng-dev g ++
  • 删除缓存
  • Installing nasm (highly recommended)
  • If the solution above doesn't work, install automake, autoconf, libtool, dpkg, pkgconfig, libpng, libpng-dev, g++
  • Remove cache