"npm run electronRebuild" failed on Joplin-2.6.10

Hi, I'm trying to build the Joplin-2.6.0 source code, but when i did the "npm run electronRebuild" cmd, it failed with the below logs.
I have tried several days with methods by searching in internet, but they didn't work, and I have read the "build_troubleshooting", please help!

My configurations:
OS: Windows10 X64
nodejs: v16.13.2 (have tried the v14.16.0, still failed)
node-gyp: v8.4.1
npm: v8.3.2
windows-build-tools: vs2015
python: v3.10.1

Error logs:

PS D:\Work\Personal-work\joplin> cd .\packages\app-desktop
PS D:\Work\Personal-work\joplin\packages\app-desktop> npm run electronRebuild

@joplin/app-desktop@2.6.10 electronRebuild
gulp electronRebuild

[16:31:11] Using gulpfile D:\Work\Personal-work\joplin\packages\app-desktop\gulpfile.js
[16:31:11] Starting 'electronRebuild'...
Running: "D:\Work\Personal-work\joplin\packages\app-desktop\tools/../node_modules/.bin/electron-rebuild.cmd" --force-abi 89 --arch ia32
[16:31:27] 'electronRebuild' errored after 15 s
[16:31:27] Error: Command failed: "D:\Work\Personal-work\joplin\packages\app-desktop\tools/../node_modules/.bin/electron-rebuild.cmd" --force-abi 89 --arch ia32

  • Searching dependency tree
    × Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'D:\Work\Personal-work\joplin\packages\lib\node_modules\sqlite3'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe failed with exit code: 1

Error: node-gyp failed to rebuild 'D:\Work\Personal-work\joplin\packages\lib\node_modules\sqlite3'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe failed with exit code: 1

at NodeGyp.rebuildModule (D:\Work\Personal-work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\module-type\node-gyp.js:109:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async ModuleRebuilder.rebuildNodeGypModule (D:\Work\Personal-work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\module-rebuilder.js:94:9)
at async Rebuilder.rebuildModuleAt (D:\Work\Personal-work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\rebuild.js:226:9)
at async Rebuilder.rebuild (D:\Work\Personal-work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\rebuild.js:184:17)
at async D:\Work\Personal-work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\cli.js:154:9

at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:529:15)
at maybeClose (internal/child_process.js:1048:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
at Process.callbackTrampoline (internal/async_hooks.js:131:14)

PS D:\Work\Personal-work\joplin\packages\app-desktop>

Why do you run electronRebuild? I think you need yarn run dist. Give it a try.

I have got the solution @HELP: Electron App does not open after following Windows building Instructions - #6 by Runo-saduwa.
It works for me.
Thanks a lot @ Runo-saduwa

It don't work, but still thanks.

What exactly are you trying to do out of interest? The post you linked predates the move of the project to yarn from npm.

For 2.6.10 if you are just trying to run the project (rather than build the .exe) you should just be able to run yarn start from the app-desktop package dir.

Just try to build a exe for a test and curious.

I can build on win10 x64 without any issues by just running yarn run dist as @roman_r_m already mentioned which is the "proper" way of building it - what actually happens when you run that?

I suspect you may have a broken installation of Visual Studio Tools. When I was using Windows I had no problem building both version on x64.

Hi, I got this error when i run the "npm run electronRebuild" cmd under the packages/app-desktop folder.
I'm new for the joplin app, i don't know what's the next step, please help!

My configurations:
OS: Win10 X64
Nodejs: v16.13.2
Joplin: v2.6.10

Error logs:
× Rebuild Failed
An unhandled error occurred inside electron-rebuild
Could not detect abi for version 14.1.0 and runtime electron. Updating "node-abi" might help solve this issue if it ectron

Error: Could not detect abi for version 14.1.0 and runtime electron. Updating "node-abi" might help solve this issuee of electron
at Object.getAbi (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\node_modules\node-abi\index.js
uild\lib\src\module-type\prebuild-install.js:61:179)
at ModuleRebuilder.prebuildInstallNativeModuleExists (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\module-rebuilder.js:64:37)
at Rebuilder.rebuildModuleAt (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\rebuild.js:202:35)
at async Rebuilder.rebuild (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\rebuild.js:184:17)
at async D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\cli.js:154:9

at ChildProcess.exithandler (node:child_process:397:12)
at ChildProcess.emit (node:events:390:28)
at ChildProcess.emit (node:domain:537:15)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
at Process.callbackTrampoline (node:internal/async_hooks:130:17)

D:\Work\joplin\packages\app-desktop>

I installed the VS2015 manually.
If i execute the "npm install -g windows-build-tools --vs2015", it will stuck at waiting installing complete log.

Moved the above topic to this one, best to resolve why the correct building method doesn't work rather than investigating each error message from running various tools manually.

If you have a recent version of node 16 you shouldn't need to do this at all as the windows tools should be present already.

When i run the "yarn run dist", i still got the same error:
Error: Could not detect abi for version 14.1.0 and runtime electron. Updating "node-abi" might help solve this issuee of electron

Can you post the entire output from it (and place it within a code fence block - triple backticks at start and end (```))

D:\Work\joplin\packages\app-desktop>yarn run dist
yarn run v1.22.17
$ npm run electronRebuild && npx electron-builder

> @joplin/app-desktop@2.6.10 electronRebuild
> gulp electronRebuild

[23:49:44] Using gulpfile D:\Work\joplin\packages\app-desktop\gulpfile.js
[23:49:44] Starting 'electronRebuild'...
Running: "D:\Work\joplin\packages\app-desktop\tools/../node_modules/.bin/electron-rebuild.cmd" --arch x64
[23:49:46] 'electronRebuild' errored after 2.46 s
[23:49:46] Error: Command failed: "D:\Work\joplin\packages\app-desktop\tools/../node_modules/.bin/electron-rebuild.cmd" --arch x64
- Searching dependency tree
× Rebuild Failed

An unhandled error occurred inside electron-rebuild
Could not detect abi for version 14.1.0 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron

Error: Could not detect abi for version 14.1.0 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron
    at Object.getAbi (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\node_modules\node-abi\index.js:30:9)
    at Rebuilder.get ABI [as ABI] (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\rebuild.js:139:39)
    at PrebuildInstall.prebuiltModuleExists (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\module-type\prebuild-install.js:61:179)
    at ModuleRebuilder.prebuildInstallNativeModuleExists (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\module-rebuilder.js:64:37)
    at Rebuilder.rebuildModuleAt (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\rebuild.js:202:35)
    at async Rebuilder.rebuild (D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\rebuild.js:184:17)
    at async D:\Work\joplin\packages\app-desktop\node_modules\electron-rebuild\lib\src\cli.js:154:9

    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:390:28)
    at ChildProcess.emit (node:domain:537:15)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
    at Process.callbackTrampoline (node:internal/async_hooks:130:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

D:\Work\joplin\packages\app-desktop>

Did you run yarn install from the root of the project before? In your case it looks to be D:\work\joplin

I did run "npm install"

Why did you try npm install? What happens if you do it with yarn install as per the instructions?

no specific reason, i just thought it's basicly same, so ...
I will try the "yarn install" now.

Fundamentally yes but (and somebody can correct me if I'm wrong here) there is no longer an npm.lock file in the project to make sure dependancies stay in check as that is now within yarn.lock - not to mention how many other things have changed when it was moved (see: Use Yarn 3 to manage monorepo installation by laurent22 · Pull Request #5833 · laurent22/joplin · GitHub)