Closed aravindjaimon closed 9 months ago
I don't think electron-builder can control this? It looks like node-pre-gyp is fully in control of what is being downloaded, right?
What happens if you force buildDependenciesFromSource: true
?
@mmaietta Tried that just now, But the issue is persisting.
I took a look at the source code for the Golang dependency electron-builder uses for handling native modules. If prebuilds are not available, the only way for buildDependenciesFromSource
to work is by building the .node
binary on each source platform (can't use wine IIRC), otherwise it'll continue forward with attempting installing a prebuilt binary.
The Golang dependency short circuits the prebuild logic if it receivesBuildFromSource: true
and isRebuildPossible := checkRebuildPossible(configuration) === true
If that still isn't working, which I can't imagine why it wouldn't, then I'm afraid you may be out of luck. Basically, if you're seeing Installing prebuilt binary
in the electron-builder logs, something is wrong with your configuration.
https://github.com/electron-userland/electron-builder/blob/ef4e8d9824e51b3c9e18fbaf5b1136a6479c82df/packages/app-builder-lib/src/util/yarn.ts#L10-L15 https://github.com/develar/app-builder/blob/4e2aa6a12e2bc3d31ec0d01d661fb3a4d65248ff/pkg/node-modules/rebuild.go#L177-L182
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity.
This is still happening, was anyone able to fix this?
Can you try using next
version 25.0.0-alpha.5
. It now uses the official electron/rebuild
package by default, which might resolve this error?
Tried with the 25.0.0-alpha.5 version didnt work, here is the log
$ npm i
proj-zerolens@11.1.1 postinstall electron-builder install-app-deps
• electron-builder version=25.0.0-alpha.5 • loaded configuration file=package.json ("build" field) • executing @electron/rebuild electronVersion=28.2.2 arch=x64 buildFromSource=false appDir=./ • installing native dependencies arch=x64 • preparing moduleName=canvas arch=x64 ⨯ Backend.cc D:\work\project\node_modules\nan\nan.h(688,37): warning C4996: 'v8::Isolate::IdleNotificationDeadline': Use MemoryPressureNotification() to influence the GC schedule. [D:\work\project\node_modules\canvas\build\canvas.vcxproj] (compiling source file '../src/backend/Backend.cc')
D:\work\project\node_modules\nan\nan.h(2548,6): error C2665: 'v8::ObjectTemplate::SetAccessor': no overloaded function could convert all the argument types [D:\work\project\node_modules\canvas\build\canvas.vcxproj]
(compiling source file '../src/backend/Backend.cc')
C:\Users\proj.electron-gyp\28.2.2\include\node\v8-template.h(816,8):
could be 'void v8::ObjectTemplate::SetAccessor(v8::Local
D:\work\project\node_modules\nan\nan.h(2596,6): error C2665: 'v8::ObjectTemplate::SetAccessor': no overloaded function could convert all the argument types [D:\work\project\node_modules\canvas\build\canvas.vcxproj]
(compiling source file '../src/backend/Backend.cc')
C:\Users\proj.electron-gyp\28.2.2\include\node\v8-template.h(816,8):
could be 'void v8::ObjectTemplate::SetAccessor(v8::Local
Error: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
failed with exit code: 1
at ChildProcess.onExit (D:\work\project\node_modules\node-gyp\lib\build.js:203:23)
at ChildProcess.emit (node:events:517:28)
at ChildProcess._handle.onexit (node:internal/child_process:292:12)
⨯ node-gyp failed to rebuild 'D:\work\project\node_modules\canvas' failedTask=installAppDeps stackTrace=Error: node-gyp failed to rebuild 'D:\work\project\node_modules\canvas'
at ChildProcess.
npm ERR! A complete log of this run can be found in: C:\Users\proj\AppData\Local\npm-cache_logs\2024-03-20T00_33_33_941Z-debug-0.log
The first error in your OP is npm ERR! Package pixman-1 was not found in the pkg-config search path.
Looks like pixman
is missing from your system.
i am using windows, how i can install it
@kotasudhakar i have same error,has solved it yet?
@kotasudhakar i have same error,has solved it yet?
The canvas library did not make any release until now using the new n-api, until that happens, unfortunately no way we can use the libraries using the canvas as dependancy. i switched to using pdfjs using as the directly in the src, without actually including it as the npm package
ok,I got it,Thanks
After
npm i
the post install script executes, which installs the electron-builder dependencies(exitzero electron-builder install-app-deps
). This one is failing when trying to install its dependency canvas.As you can see from the error log, It is searching for a canvas from https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-electron-v21.4-linux-glibc-x64.tar.gz but that doesnt exist. The canvas that exist is in the vesion of node, but its searching for an electron version of node.
Not sure how to solve it. Any suggestions.
When I try normal npm i its working fine, but when building the app in electron-builder container, and in wine and also in mac, its failing.