Comments (5)
from node-tree-sitter.
After writing the following I got the sense that cloning this repository and trying to use tree-sitter from within it isn't really an intended scenario. I'll leave the rest of the post here though as it may have some clues regarding various build / installation issues.
Old content follows.
I don't use pnpm but I just tested some installation-like steps using 16f7319 (note that's the latest commit on the "default" branch here as of this writing) with a number of Node.js / npm versions using nvm.
What I found is that success varied, depending on at least a few things.
First, I used --recursive
when cloning the repository, so just git clone https://github.com/tree-sitter/node-tree-sitter
didn't lead to successful builds [1].
Then, for the following versions of Node.js, npm install
completes successfully:
- v12.22.12
- v14.21.1
- v16.19.0
npx tree-sitter dump-languages
didn't work for v16.19.0 (though it did work for the other 2 versions), so although it appears building was successful for that version, that doesn't by itself seem sufficient for use (at least of the cli).
npm install
didn't successfully complete here for the following versions:
- v18.14.1
- v19.6.1
As I understand it, npm is capable of using node-gyp (one it depends on / is bundled with) to handle the case of binding.gyp
being in a project's repository -- i.e. this is without a project specifically having node-gyp as a dependency or devDependency. I may be wrong about this though -- it doesn't seem so straight-forward to get answers to these sorts of things unfortunately.
As some evidence in favor of the above idea though, according to this nicely buried piece of documentation:
If there is a binding.gyp file in the root of your package and you haven't defined your own install or preinstall scripts, npm will default the install command to compile using node-gyp.
That's for v6 of npm, but looking at the corresponding page for more recent versions one can see similar text.
Perhaps the code in 16f7319 of node-tree-sitter doesn't play so well with more recent versions of Node.js / npm.
[1] IIUC, there is a git submodule involved so that needs to be attended to appropriately I guess (possibly using git submodule
subcommands like init
and update
if --recursive
or other is not using during a clone).
from node-tree-sitter.
I'm experiencing the same issue when trying npm install tree-sitter
, both in Windows Subsystem for Linux 2 (which uses Ubuntu), and in MacOS.
WSL2 (Ubuntu) output:
prebuild-install WARN install No prebuilt binaries found (target=19.7.0 runtime=node arch=x64 libc= platform=linux)
MacOS output:
prebuild-install WARN install No prebuilt binaries found (target=19.7.0 runtime=node arch=x64 libc= platform=darwin)
I tried with older versions of Node and had the same issue. Not sure how to proceed.
from node-tree-sitter.
I'm not sure I parse the errors you posted correctly, but the sense I get is that those are for node 19.7.0, which I didn't have any luck with (along with the 18 series).
It seems though that some people have had success with 18 (though not 19). Here is another report of some success with 18.
If it's practical for you to try with node 12.x or 14.y may be it's worth it? Or may be you tried and got errors? If so, would you mind sharing them?
It was unclear to me whether any of the 16 series would work either based on my own testing, but there is also a report here of lack of success on that front -- though at the end it seems another person may have resolved things.
from node-tree-sitter.
This comment might be of interest if trying to get things working with Node.js 19.x.
from node-tree-sitter.
Related Issues (20)
- salt
- .
- Silently fails while importing on VSCode extension debugger HOT 8
- Node module version mismatch when integrating tree-sitter with VS Code extension HOT 4
- Implicit use of wrong grammar when multiple grammar directories are present HOT 2
- electron version 19.0.17 HOT 3
- Special characters in rule names cause Uncaught SyntaxError HOT 2
- Electron error HOT 1
- BFS not working, some internal problem with cursor HOT 1
- Consider making Query matches/captures iterators
- Support for all query predicates supported by "official" tree sitter queries
- Tree.rootNode undefined in jest tests due to race condition HOT 2
- Repository name change name to tree-sitter-node HOT 2
- .
- The module 'l\node_modules\tree-sitter\build\Release\tree_sitter_runtime_binding.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 115. This version of Node.js requires NODE_MODULE_VERSION 118. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`) HOT 3
- Can't use in VS Code extension HOT 4
- Invalid language object with tree-sitter v0.21 - caused by NAPI? HOT 4
- node siter fails when included in a react based project and webpack >5 HOT 3
- intermittent `TypeError: NodeClass is not a constructor` when getting tree nodes HOT 7
- Nonexistent property `QueryCapture.text` in typings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-tree-sitter.