After upgrading to LazyVim 15.x, the following error appeared during nvim-treesitter parser installations:
Error during "tree-sitter build": error: Could not locate executable `tree-sitter` in your project.
Please ensure that all project dependencies are installed with `npm install` or `yarn install
Many users encountered this issue, and most users fixed it by installing tree-sitter-cli which puts a tree-sitter binary on the PATH. This is a hard requirement of the latest version of nvim-tree-sitter
But for me, this occurred despite the tree-sitter binary being available on the system PATH when tested in a regular shell (where.exe tree-sitter worked fine).
Apparent Root Cause
The issue might stem from Volta’s shimming strategy. Volta manages Node.js versions and global executables by creating shims that dynamically route to the appropriate tools through the Volta executable itself. However, in this particular case, it appears that Neovim fails to use these shims correctly, effectively making it “blind” to Volta-managed executables in certain situations. This might only be a problem on Windows.
Confirmed Solution
Switch from Volta to nvm-windows:
- Uninstall Volta
- Remove any Volta related directories from the PATH
- Install nvm-windows
- Follow standard nvm-windows installation
- Ensure
tree-sitter-cliis installed globally:nvm install ltsnvm use ltsnpm install -g tree-sitter-cli
- Verify with
where.exe tree-sitter. It should no longer point to a volta directory; if it does, restart terminal, or even safer, restart Windows entirely. - Start Neovim and reinstall parsers with
:TSUpdateif it doesn’t automatically trigger