Skip to content

Commit 430ce44

Browse files
authored
Add back build dependencies for node-canvas
1 parent 00445ef commit 430ce44

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,28 @@ jobs:
2727
with:
2828
node-version: 'lts/*'
2929
cache: 'pnpm'
30+
# Install dependencies for node-canvas to avoid errors like this
31+
# while building from source:
32+
#
33+
# ```
34+
# .../canvas@3.1.0/node_modules/canvas install: Package pixman-1 was not found in the pkg-config search path.
35+
# .../canvas@3.1.0/node_modules/canvas install: Perhaps you should add the directory containing `pixman-1.pc'
36+
# .../canvas@3.1.0/node_modules/canvas install: to the PKG_CONFIG_PATH environment variable
37+
# .../canvas@3.1.0/node_modules/canvas install: Package 'pixman-1', required by 'virtual:world', not found
38+
# .../canvas@3.1.0/node_modules/canvas install: gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
39+
# .../canvas@3.1.0/node_modules/canvas install: gyp ERR! configure error
40+
# .../canvas@3.1.0/node_modules/canvas install: gyp ERR! stack Error: `gyp` failed with exit code: 1
41+
# .../canvas@3.1.0/node_modules/canvas install: gyp ERR! stack at ChildProcess.<anonymous> (/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.5.2/node_modules/pnpm/dist/node_modules/node-gyp/lib/configure.js:317:18)
42+
# .../canvas@3.1.0/node_modules/canvas install: gyp ERR! stack at ChildProcess.emit (node:events:518:28)
43+
# .../canvas@3.1.0/node_modules/canvas install: gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
44+
# .../canvas@3.1.0/node_modules/canvas install: gyp ERR! System Linux 6.8.0-1021-azure
45+
# .../canvas@3.1.0/node_modules/canvas install: gyp ERR! command "/opt/hostedtoolcache/node/22.14.0/x64/bin/node" "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.5.2/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
46+
# .../canvas@3.1.0/node_modules/canvas install: gyp ERR! cwd /home/runner/work/security-vulnerability-examples-next-js-postgres/security-vulnerability-examples-next-js-postgres/node_modules/.pnpm/canvas@3.1.0/node_modules/canvas
47+
# ```
48+
#
49+
# - https://github.com/Automattic/node-canvas/issues/1065#issuecomment-2691025715
50+
- name: Install dependencies for node-canvas
51+
run: sudo apt-get install libcairo2-dev libpango1.0-dev
3052
- name: Install dependencies
3153
run: pnpm install
3254
- run: pnpm migrate up

0 commit comments

Comments
 (0)