Automattic / Automattic/node-canvas
Problem installing on node 16 + Ubuntu 20.4
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
## Issue or Feature
I updated node to v16 using snap, now canvas won't install any more.
## Steps to Reproduce
package.json
```js
{
"dependencies": {
"canvas": "2.8.0",
}
}
```
Run npm install. It fails with:
```
npm ERR! code 1
npm ERR! path /home/michael/.../server/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! A complete log of this run can be found in:
npm ERR! /home/michael/.npm/_logs/2021-05-30T20_01_35_714Z-debug.log
```
The log does not show any error:
```
....
1359 info run canvas@2.8.0 install node_modules/canvas node-pre-gyp install --fallback-to-build
1360 info run canvas@2.8.0 install { code: 1, signal: null }
1361 timing reify:rollback:createSparse Completed in 797ms
1362 timing reify:rollback:retireShallow Completed in 0ms
1363 timing command:install Completed in 6498ms
1364 verbose stack Error: command failed
1364 verbose stack at ChildProcess. (/snap/node/4650/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
1364 verbose stack at ChildProcess.emit (node:events:365:28)
1364 verbose stack at maybeClose (node:internal/child_process:1067:16)
1364 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
1365 verbose pkgid canvas@2.8.0
1366 verbose cwd /home/michael/.../server
1367 verbose Linux 5.8.0-53-generic
1368 verbose argv "/snap/node/4650/bin/node" "/snap/node/4650/bin/npm" "install"
1369 verbose node v16.2.0
1370 verbose npm v7.13.0
1371 error code 1
1372 error path /home/michael/...server/node_modules/canvas
1373 error command failed
1374 error command sh -c node-pre-gyp install --fallback-to-build
1375 verbose exit 1
```
I did install the dependencies as stated in the readme. It seems that there should be a prebuilt binary available for this platform, but it was not downloaded.
This seems to be a problem with using the snap package:
```
May 30 22:17:12 michael-xxx systemd[1243]: Started snap.node.node.84bde3de-c682-49a0-990c-15608767415b.scope.
May 30 22:17:12 michael-xxx kernel: [10933.732722] audit: type=1400 audit(1622405832.616:118): apparmor="DENIED" operation="file_inherit" profile="/snap/snapd/11841/usr/lib/snapd/snap-confine" pid=22651 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none
May 30 22:17:12 michael-xxx kernel: [10933.732728] audit: type=1400 audit(1622405832.616:119): apparmor="DENIED" operation="file_inherit" profile="/snap/snapd/11841/usr/lib/snapd/snap-confine" pid=22651 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none
May 30 22:17:12 michael-xxx kernel: [10933.732731] audit: type=1400 audit(1622405832.616:120): apparmor="DENIED" operation="file_inherit" profile="/snap/snapd/11841/usr/lib/snapd/snap-confine" pid=22651 comm="snap-confine" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none
May 30 22:17:12 michael-xxx systemd[1243]: snap.node.node.84bde3de-c682-49a0-990c-15608767415b.scope: Succeeded.
```
I did check out node-canvas from source and run `npm install` (successfull, downloads prebuilt) and `npm install --build-from-source` (successful, compiles)
## Your Environment
* canvas 2.8.0
* Ubuntu 20.04.1 LTS
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.