首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“`gatsby plugin”和“`mozjpeg`”的依赖关系是什么?

“`gatsby plugin”和“`mozjpeg`”的依赖关系是什么?
EN

Stack Overflow用户
提问于 2021-03-07 16:12:40
回答 2查看 525关注 0票数 0

gatsby-plugin-sharp (或者更具体地说是子依赖项mozjpeg)存在一个问题,它会给出异常autoreconf: not found,但问题实际上与其他依赖项有关。在不同的帖子中,人们找到了各种依赖关系的组合,以使其为他们工作(如https://stackoverflow.com/a/66170062/2475012https://github.com/gatsbyjs/gatsby/issues/19432#issuecomment-553644600)。但是,在任何地方似乎都没有确切列出所需依赖项的列表。

我正在ubuntu-latest上的ubuntu-latest操作上运行盖茨比。我的package.json

代码语言:javascript
复制
{
  "name": "matt.si",
  "private": false,
  "description": "Mattsi Jansky's personal blog",
  "author": "Mattsi Jansky",
  "scripts": {
    "build": "gatsby build",
    "dev": "gatsby develop",
    "test": "jest",
    "test:updateSnapshots": "jest --updateSnapshot",
    "test:visual": "yarn build && ./scripts/run-visual-regression-tests.sh",
    "test:visual:update": "docker-compose run visual-regression-tests reference",
    "test:visual:approve": "docker-compose run visual-regression-tests approve",
    "test:visual:report": "open tests/visual/backstop_data/html_report/index.html",
    "lint": "eslint --ext .js,.jsx --ignore-pattern public ."
  },
  "dependencies": {
    "babel-preset-gatsby": "0.5.1",
    "gatsby": "2.24.87",
    "gatsby-image": "2.4.21",
    "gatsby-plugin-feed": "2.5.19",
    "gatsby-plugin-google-analytics": "2.3.19",
    "gatsby-plugin-manifest": "2.4.35",
    "gatsby-plugin-offline": "3.2.37",
    "gatsby-plugin-react-helmet": "3.3.14",
    "gatsby-plugin-sass": "2.3.21",
    "gatsby-plugin-sharp": "3.0.0",
    "gatsby-remark-footnotes": "0.0.7",
    "gatsby-remark-images": "3.3.39",
    "gatsby-remark-prismjs": "3.5.16",
    "gatsby-source-filesystem": "2.3.36",
    "gatsby-transformer-remark": "2.8.46",
    "gatsby-transformer-sharp": "2.5.20",
    "identity-obj-proxy": "3.0.0",
    "node-sass": "4.14.1",
    "prismjs": "1.22.0",
    "prop-types": "15.7.2",
    "react": "16.14.0",
    "react-dom": "16.14.0",
    "react-helmet": "6.1.0",
    "react-test-renderer": "16.14.0",
    "rehype-react": "6.1.0"
  },
  "devDependencies": {
    "babel-jest": "26.6.1",
    "enzyme": "3.11.0",
    "enzyme-adapter-react-16": "1.15.5",
    "eslint": "7.12.0",
    "eslint-plugin-react": "7.21.5",
    "jest": "26.6.1",
    "wait-on": "5.2.0"
  },
  "license": "GPL-3.0-only"
}

GitHub操作定义的相关部分:

代码语言:javascript
复制
name: Run tests
on: [push]

jobs:
  build:
    name: Run Tests
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      
      - name: Install System Dependencies
        run: sudo apt-get update && sudo apt-get install make nasm autoconf automake libtool dpkg pkg-config libpng-dev g++

      - name: Install Project Dependencies
        uses: borales/actions-yarn@v2.1.0
        with:
          cmd: install

它在autoreconf: not foundInstall Project Dependencies步骤中失败。我尝试将autoreconf添加到Install System Dependencies步骤,但它已经是最新版本了。我试过buildessentials,但它也是最新版本。我添加了libvips-dev,它似乎是apt-getlibvips库的名称,而这个库确实安装了。在查找了mozjpeg (https://stackoverflow.com/a/64927666/2475012)中的相同问题后,我添加了sudo apt-get install make nasm autoconf automake libtool dpkg pkg-config libpng-dev g++。但除了nasm之外,所有这些都已经存在了。

但每次我还是有autoreconf: not found的时候。具体来说,完全错误(https://github.com/Mattsi-Jansky/matt.si/runs/2051073618):

代码语言:javascript
复制
[4/4] Building fresh packages...
error /github/workspace/node_modules/mozjpeg: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments: 
Directory: /github/workspace/node_modules/mozjpeg
Output:
⚠ spawn /github/workspace/node_modules/mozjpeg/vendor/cjpeg ENOENT
  ⚠ mozjpeg pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c autoreconf -fiv
/bin/sh: autoreconf: not found


    at /github/workspace/node_modules/bin-build/node_modules/execa/index.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 0)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

所以我不知所措。我想我的问题是:( a)我是否在这里跟踪正确的线程,试图找到正确的依赖项?( b)我应该添加的依赖项到底是什么?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-04-09 16:58:45

通过将borales/actions-yarn的用法替换为包含纱线的设置节点来解决这一问题。

borales/actions-yarn是为GitHub操作测试版设计的,并不是运行纱线操作的推荐方法。它们以某种传统的方式运行。我对细节不太清楚,但我认为所发生的事情是,borales/actions-yarn运行在一个没有安装依赖项的单独映像上。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66518612

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档