今天,我在GitHub上创建了一个PR,但我的操作开始失败,并显示以下内容:
npm ERR! code 1
npm ERR! path /home/runner/work/solid-polls/solid-polls/client/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/home/runner/work/solid-polls/solid-polls/client/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/runner/work/solid-polls/solid-polls/client/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.10
npm ERR! node-pre-gyp info using node@18.14.2 | linux | x64
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v108-linux-glibc-x64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v108-linux-glibc-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.9.3 and node@18.14.2 (node-v108 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.3/canvas-v2.9.3-node-v108-linux-glibc-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.14.2 | linux | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.14.2 | linux | x64
npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.14.2/node-v18.14.2-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.14.2/node-v18.14.2-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.14.2/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.14.2/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/runner/work/solid-polls/solid-polls/client/node_modules/canvas/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/runner/.cache/node-gyp/18.14.2/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/home/runner/.cache/node-gyp/18.14.2',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/runner/.cache/node-gyp/18.14.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/runner/work/solid-polls/solid-polls/client/node_modules/canvas',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Package pangocairo was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pangocairo.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pangocairo' found
npm ERR! gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.15.0-10[33](https://github.com/Dtabisolutions/solid-polls/actions/runs/4337222211/jobs/7573072720#step:4:34)-azure
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/home/runner/work/solid-polls/solid-polls/client/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/runner/work/solid-polls/solid-polls/client/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd /home/runner/work/solid-polls/solid-polls/client/node_modules/canvas
npm ERR! gyp ERR! node -v v18.14.2
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/home/runner/work/solid-polls/solid-polls/client/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/runner/work/solid-polls/solid-polls/client/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/runner/work/solid-polls/solid-polls/client/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)
npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Linux 5.15.0-1033-azure
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/home/runner/work/solid-polls/solid-polls/client/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm ERR! node-pre-gyp ERR! cwd /home/runner/work/solid-polls/solid-polls/client/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v18.14.2
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.10
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2023-03-05T17_[38](https://github.com/Dtabisolutions/solid-polls/actions/runs/4337222211/jobs/7573072720#step:4:39)_[45](https://github.com/Dtabisolutions/solid-polls/actions/runs/4337222211/jobs/7573072720#step:4:46)_7[61](https://github.com/Dtabisolutions/solid-polls/actions/runs/4337222211/jobs/7573072720#step:4:62)Z-debug-0.log
make: *** [Makefile:15: build-client] Error 1
Error: Process completed with exit code 2.
奇怪的是,我没有对之前的PR做任何修改,之前的PR成功地完成了操作。我没有安装任何新的npm包或类似的东西,只是在我的应用中添加了一些功能。此外,在GitHub操作中运行的相同命令也成功地在本地传递。
如果有人能帮我解决这个问题,我会很高兴,因为我就是找不到答案/解决方案。
下面是我的yml:
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on pull request events but only for the master branch
pull_request:
branches: [develop]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build the API
run: make build-api
- name: Build the Admin UI
run: make build-client
- name: Build the Mobile App UI
run: make build-mobile
它在包含以下命令的make-build-client
上失败:rm -rf ./dist/admin-ui && cd ./client && npm ci --legacy-peer-deps && npm run build
1条答案
按热度按时间bnl4lu3b1#
我通过更改工作流文件以基于矩阵设置节点版本来解决这个问题,我还更改了
16.x -> 16
。以下是更新后的文件:如果有人想在本地测试工作流,但不知道如何测试,可以使用act。这里还有一个视频,说明如何使用used。
感谢@EstusFlask为我指明了那个方向!