Automattic / Automattic/node-canvas
Using canvas in Electron
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 1
Description
## Issue or Feature
- [x] If this is an issue with installation, I have read the [troubleshooting guide](https://github.com/Automattic/node-canvas/issues/1511).
## Steps to Reproduce
When installing canvas in an Electron application, I get the following application when `electron-builder` builds the project:
```
rebuilding native dependencies dependencies=canvas@2.9.3 platform=darwin arch=x64
⨯ cannot execute cause=exit status 1 errorOut=npm ERR! code 1
npm ERR! path /Users/XXX/Code/YYY/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 '/Users/XXX/.nvm/versions/node/v16.16.0/bin/node /Users/XXX/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/XXX/Code/YYY/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/XXX/Code/YYY/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v20.0' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
...
```
Does canvas do not have prebuilds available for Electron? Why cant `electron-builder` rebuild the native canvas dependencies - I never had this issue with any node module before... Is this a bug or a missing feature?
## Your Environment
* Version of node-canvas (output of `npm list canvas` or `yarn list canvas`): canvas@2.9.3
* Environment (e.g. node 4.2.0 on Mac OS X 10.8): Node v16.16.0 on macOS Catalina 10.15.7
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.