Closed verhovsky closed 1 year ago
Any update on this?
Any update on this?
Or workaround 😄
Does anybody know how to fix the bug or has a link to a working package?
Looks like this was fixed by 0.20.1
~$ cd /tmp
/tmp$ mkdir tree-sitter-test
/tmp$ cd tree-sitter-test
/tmp/tree-sitter-test$ npm init -y
Wrote to /private/tmp/tree-sitter-test/package.json:
{
"name": "tree-sitter-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
/tmp/tree-sitter-test$ npm install tree-sitter
added 59 packages, and audited 60 packages in 13s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
/tmp/tree-sitter-test$ node --version
v18.11.0
/tmp/tree-sitter-test$ npm --version
8.19.2
Looks like this was fixed by 0.20.1
sadly not, am still getting error of
failed: The module '/xxx/node_modules/tree-sitter/build/Release/tree_sitter_runtime_binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 108. This version of Node.js requires
NODE_MODULE_VERSION 106. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`)..
there is no 106 check https://nodejs.org/en/download/releases/
@ctf0 I think you just need to do
rm -rf ./node_modules
# or
# rm -rf ./node_modules/tree-sitter
npm install
@ctf0 I think you just need to do
rm -rf ./node_modules # or # rm -rf ./node_modules/tree-sitter npm install
already did that 😔
What is your node --version
and npm --version
?
The 106 is saying that your Node is ABI version 106, which is weird because it doesn't exist in that table. Are you running on Electron version 19 (with Node 16)? because then your issue seems unrelated, you should open a different issue.
@verhovsky
node: v19.2.0
npm: 8.19.3
Are you running on Electron version 19 (with Node 16)?
am trying to use the pkg inside vscode extension
Version: 1.74.0-insider
Commit: 493a541735b84de36b628750ba716a430669cb7f
Date: 2022-12-02T05:22:22.871Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 21.6.0
Sandboxed: Yes
Were you able to solve this issue ?
@abhinavkamazon your issue (assuming it's the same as @ctf0's) is not the issue you're commenting on. As I said here, I think this package is installable on Node 18 now. Your issue is that you're using an old Node version (you're using Electron's Node, not the Node you're using to run your project).
You will need to ask/help maxbrunsfeld compile this project for your version, but this is unlikely because there are like 40 tree-sitter repositories (and they need to be released on both npm and Rust's crates.io) and I suppose he has better things to do than make 80 different releases or find someone that he trusts (I asked) to make releases.
Otherwise, you will have to upgrade your Electron version. In a week (February 7th), Electron 23 should be released and I think that will come with Node 18, so node-tree-sitter should work there, let us know if you try this.
You could try using an old version of node-tree-sitter by doing a binary search npm install
ing old versions to find the last supported version. Please let everyone on this issue know which version works if you do this.
You could git clone git@github.com:tree-sitter/node-tree-sitter.git
into a different directory, compile the project yourself locally and add it as a file dependency in package.json like this:
{
...
"dependencies": {
"node-tree-sitter": "file:../node-tree-sitter",
...
}
}
in this example package.json, node-tree-sitter/ is cloned into the same directory as your project i.e.
You could fork this repo, compile and publish your own package under a namespace. I do this with tree-sitter-bash because there hasn't been a new release since May 2021.