webhintio.github.io
webhintio.github.io copied to clipboard
Electron node-gyp canvas package not found.
Bug report:
While I refer to https://webhint.io/docs/user-guide/troubleshoot/summary/ which explains about the issue with canvas,
While using it with electron , the electron-rebuild
process gives an error when it doesn't found the relevant canvas package
716 error [email protected] install:
node-pre-gyp install --fallback-to-build`,
Thus leading to fail the build and thus can't use webhints programmatically.,
Frameworks & versions.
Node 12.18.3, Electron 8.3.0
Hi @paragdiwan,
Sorry for the late response.
From the error it seems like you are running it directly inside electron. Is that right? Native modules need to be recompiled for Electron and unfortunately canvas
is not an easy one to compile...
What is the scenario you are trying to achieve? canvas
is used by the jsdom connector but you can probably use the puppeteer connector.
Hi @paragdiwan,
Sorry for the late response. From the error it seems like you are running it directly inside electron. Is that right? Native modules need to be recompiled for Electron and unfortunately
canvas
is not an easy one to compile...What is the scenario you are trying to achieve?
canvas
is used by the jsdom connector but you can probably use the puppeteer connector.
@molant
Yes you said right. I am trying to run webhints
within the electron. irrespective of any connector, i.e. even before the execution step, the electron rebuilding
process gives the error.
Do you have a repo we can clone with some steps to reproduce the error? I'm not sure what do I have to do to see the same problem you do right now.
Thanks!
@paragdiwan, just following up to see if you have a sample repo you could share so we can try to repro your issue. Thanks!