Giter Site home page Giter Site logo

Comments (5)

verhovsky avatar verhovsky commented on May 27, 2024 1

pnpm/pnpm#4347

from node-tree-sitter.

sogaiu avatar sogaiu commented on May 27, 2024

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.

davidluhr avatar davidluhr commented on May 27, 2024

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.

sogaiu avatar sogaiu commented on May 27, 2024

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.

sogaiu avatar sogaiu commented on May 27, 2024

This comment might be of interest if trying to get things working with Node.js 19.x.

from node-tree-sitter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.