webhintio.github.io icon indicating copy to clipboard operation
webhintio.github.io copied to clipboard

Electron node-gyp canvas package not found.

Open paragdiwan opened this issue 4 years ago • 4 comments

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

paragdiwan avatar Sep 08 '20 06:09 paragdiwan

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 avatar Sep 11 '20 23:09 molant

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.

paragdiwan avatar Sep 13 '20 04:09 paragdiwan

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!

molant avatar Sep 13 '20 05:09 molant

@paragdiwan, just following up to see if you have a sample repo you could share so we can try to repro your issue. Thanks!

hxlnt avatar Oct 16 '20 15:10 hxlnt