Repository navigation
Closed
Description
This is Windows 11, 64-bit. Create a package.json like so:
{
"name": "test",
"version": "1.0.0",
"description": "test",
"author": "s100"
}Then run:
npm install tree-sitter
npm install --save-dev electron electron-builder
npx electron-builderI see this error:
• electron-builder version=23.6.0 os=10.0.22000
• writing effective config file=dist\builder-effective-config.yaml
• rebuilding native dependencies [email protected] platform=win32 arch=x64
• install prebuilt binary name=tree-sitter version=0.20.1 platform=win32 arch=x64 napi=
• build native dependency from sources name=tree-sitter
version=0.20.1
platform=win32
arch=x64
napi=
reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
error=C:\...\test\node_modules\node-abi\index.js:36
throw new Error('Could not detect abi for version ' + target + ' and runtime ' + runtime + '. Updating "node-abi" might help solve this issue if it is a new release of ' + runtime)
^
Error: Could not detect abi for version 22.3.2 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron
at getAbi (C:\...\test\Downloads\a\node_modules\node-abi\index.js:36:9)
at module.exports (C:\...\test\Downloads\a\node_modules\prebuild-install\rc.js:52:57)
at Object.<anonymous> (C:\...\test\Downloads\a\node_modules\prebuild-install\bin.js:8:25)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
This is happening because tree-sitter depends on prebuild-install@^6.0.1, which resolves to [email protected], which depends on node-abi@^2.21.0, which resolves to [email protected], which is from August 2021 and only recognises versions of Electron up to 15.x.y. As seen above, we're up to Electron 22.3.2 right now.
This can be fixed by upgrading to prebuild-install@7, which uses node-abi@3, which recognises all the latest versions of Electron. Note however that prebuild-install@7 dropped support for Node.js < 10, which means tree-sitter would too. This may require a minor version bump on your part.
Metadata
Metadata
Assignees
Labels
No labels
Activity
logesh-jarvis commentedon Jun 14, 2023
Any timeline when this will be fixed