Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree-sitter executable not found #1097

Closed
boydkelly opened this issue Mar 24, 2021 · 11 comments
Closed

tree-sitter executable not found #1097

boydkelly opened this issue Mar 24, 2021 · 11 comments
Labels
bug Something isn't working

Comments

@boydkelly
Copy link

boydkelly commented Mar 24, 2021

Im using

NVIM v0.5.0-dev+1170-g691a72bb6
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

in a Fedora 34 container (neovim nightly and tree-sitter installed from copr repo)

running checkhealth I get the message:

WARNING:tree-sitter executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)

I also have npm tree-sitter and nmp tree-sitter-cli installed.

I'm not even sure if this is redundant or not. Just that it was working recently in F33 container.

I also have a lot of these messages in checkhealth:

The following errors have been detected:
 - ERROR: yaml(highlights): /usr/share/nvim/runtime/lua/vim/treesitter/          language.lua:33: ABI version mismatch for /var/home/bkelly/.local/share/        nvim/site/pack/packer/start/nvim-treesitter/parser/yaml.so: supported           between 13 and 13, found 11
 - ERROR: yaml(locals): /usr/share/nvim/runtime/lua/vim/treesitter/              language.lua:33: ABI version mismatch for /var/home/bkelly/.local/share/        nvim/site/pack/packer/start/nvim-treesitter/parser/yaml.so: supported           between 13 and 13, found 11

Any suggestions here? Thank you very much!

@boydkelly boydkelly added the bug Something isn't working label Mar 24, 2021
@boydkelly
Copy link
Author

boydkelly commented Mar 24, 2021

Ok all solved here. It seems that yarn was causing the problem. It seems yarn v2 doesn't support global package install. I removed yarn and reinstalled treesitter with npm and checkhealth is fine. I'm still left with the question as to what the fedora tree-sitter package provides here. Its a dependency of neovim, but is it being replace by npm?

@theHamsta
Copy link
Member

Yarn and npm support global install. The binaries are not added to path automatically. You need to reinstall the yaml parser to get the new ABI

@boydkelly
Copy link
Author

I did reinstall all the parsers. But yarn v2 does not support global install. ;) See: yarn global install issue
This is what really led to my problems. I ended up recreating my container etc. and doing headstands, before I finally figured out.

Anyway all is working fine now.

But I'm still trying to figure out the relationship and/or difference between the tree-sitter rpm and npm packages. Without the npm package I will get the executable not found error although the Fedora treesitter package is installed.

@horseinthesky
Copy link

horseinthesky commented Mar 27, 2021

Still getting

## Installation
  - WARNING: `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required       for :TSInstall)

in `checkhealth.

Manual install fails:

sudo npm install -g tree-sitter

> tree-sitter@0.19.0 install /usr/lib/node_modules/tree-sitter
> prebuild-install || node-gyp rebuild

prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/13.14.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/tree-sitter/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/tree-sitter/.node-gyp'
gyp ERR! System Linux 4.19.104-microsoft-standard
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/tree-sitter
gyp ERR! node -v v13.14.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tree-sitter@0.19.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tree-sitter@0.19.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-03-27T20_36_43_013Z-debug.log

@theHamsta
Copy link
Member

theHamsta commented Mar 29, 2021

@horseinthesky the system npm does usually not work with global installations. You probably also don't want to install npm packages as root. You can download download tree-sitter from here: https://github.com/tree-sitter/tree-sitter/releases or via cargo install tree-sitter or using brew, or brew install npm. I you need more help, feel free to open an issue at upstream tree-sitter. Please note that you do not need this binary for using nvim-treesitter (:TSInstall will use the C files directly without the need of tree-sitter CLI)

@boydkelly
Copy link
Author

boydkelly commented Mar 29, 2021 via email

@horseinthesky
Copy link

@theHamsta @boydkelly
I wonder why it even yells that there is no executable if it doesn't need it?! It was working perfectly fine severa days ago.

@theHamsta
Copy link
Member

theHamsta commented Oct 19, 2021

It will always report this in healthcheck when it's not there. However, you will only need it for some parsers that require :TSInstallFromGrammar

@aonoriaga
Copy link

u need install tree-sitter-cli

yarn global add tree-sitter-cli

@LeoniePhiline
Copy link

This is also true for cargo users:

cargo install tree-sitter-cli (instead of cargo install tree-sitter): https://github.com/tree-sitter/tree-sitter/tree/master/cli

@hopezh
Copy link

hopezh commented Dec 31, 2022

This is also true for cargo users:

cargo install tree-sitter-cli (instead of cargo install tree-sitter): https://github.com/tree-sitter/tree-sitter/tree/master/cli

Thanks for the suggestion, which helped me got rid of that warning after I installed rust+cargo and then tree-sitter-cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants