Open ahzf opened 7 months ago
hi, has any solution yet?
Maybe config is missing for Electron: https://github.com/nodejs/node-gyp?tab=readme-ov-file#build-for-third-party-nodejs-runtimes I have the same error:
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and electron@27.3.11 (electron-v27.3 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-electron-v27.3-win32-unknown-x64.tar.gz
there is no canvas-v2.11.2-electron-v27.3-win32-unknown-x64.tar.gz
pre-built package for electron here: https://github.com/Automattic/node-canvas/releases
The electron must be excluded to find binaries and will not try to compile with node-gyp.. or maye we can add canvas-v2.11.2-electron-v27.3
binary in releases @zbjornson ?
I can confirm that it works with "postinstall": "rimraf node_modules/canvas"
canvas is optional dependency for pdfjs-dist and this fix issue for me: npm install --no-optional
Maybe config is missing for Electron: https://github.com/nodejs/node-gyp?tab=readme-ov-file#build-for-third-party-nodejs-runtimes I have the same error:
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and electron@27.3.11 (electron-v27.3 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-electron-v27.3-win32-unknown-x64.tar.gz
there is no
canvas-v2.11.2-electron-v27.3-win32-unknown-x64.tar.gz
pre-built package for electron here: https://github.com/Automattic/node-canvas/releasesThe electron must be excluded to find binaries and will not try to compile with node-gyp.. or maye we can add
canvas-v2.11.2-electron-v27.3
binary in releases @zbjornson ?I can confirm that it works with
"postinstall": "rimraf node_modules/canvas"
Thank you so much, removing this folder node_module/canvas
worked for me.
I have an Elctron ^30.0.0 app with electron-builder ^24.13.3 and it works fine, until I add pdfjs-dist: ^4.1.392! Then I run into the following issue with ~/node_modules/canvas:
Yet, the "funny" solution from this guy https://www.reddit.com/r/electronjs/comments/15gxnmu/electron_builder_error_with_canvas/ works fine. When I just delete
~/node_modules/canvas
before I run electron-builder everything works as expected!Any idea how to solve that beside adding the removal of ~/node_modules/canvas into the build script?
The entire Open Source project can be found here: https://github.com/OpenChargingCloud/ChargyDesktopApp