Reputation: 123
I am very new to neovim and the vim ecosystem. I am still trying to get started with my own config file, however, I am running into an issue when downloading Kickstart from https://github.com/nvim-lua/kickstart.nvim. I copied the init.lua file into my own file and ran it. It downloaded all of the correct things, however, there seems to be an issue with the treesitter plugin. When I ran :so
on my init.lua
file, it gave and error.
Re-sourcing your config is not supported with lazy.nvim
Error detected while processing :source (no file):
No C compiler found! "cc", "gcc", "clang", "cl", "zig" are not executable.
This is my second time trying to deal with treesetter. The first time around I downloaded GCC to try and fix the issue. Nothing worked so I decided to delete the whole thing and download kickstart to begin the config process. I need a bit of help with this issue as I am not familiar with Vim yet.
Edit:
This is the :checkhealth nvim-treesitter
command that gave the following.
nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
- WARNING: `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
- OK: `node` found v16.14.2 (only needed for :TSInstallFromGrammar)
- OK: `git` executable found.
- OK: `gcc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: gcc (MinGW.org GCC-6.3.0-1) 6.3.0
- OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
## OS Info:
{
machine = "x86_64",
release = "10.0.22621",
sysname = "Windows_NT",
version = "Windows 10 Home"
}
## Parser/Features H L F I J
- c x x x x x
- cpp x x x x x
- go x x x x x
- help x . . . x
- javascript x x x x x
- lua x x x x x
- python x x x x x
- rust x x x x x
- tsx x x x x x
- typescript x x x x x
- vim x x x . x
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang}
## The following errors have been detected:
- ERROR: c(highlights): Failed to load parser: uv_dlopen: C:\Users\sadda\AppData\Local\nvim-data\lazy\nvim-treesitter\parser\c.so is not a valid Win32 application.
c(highlights) is concatenated from the following files:
| [ERROR]:"C:\Users\sadda\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\c\highlights.scm", failed to load: Failed to load parser: uv_dlopen: C:\Users\sadda\AppData\Local\nvim-data\lazy\nvim-treesitter\parser\c.so is not a valid Win32 application.
- ERROR: c(locals): Failed to load parser: uv_dlopen: C:\Users\sadda\AppData\Local\nvim-data\lazy\nvim-treesitter\parser\c.so is not a valid Win32 application.
As you can see, gcc is available, so I am not sure why this is not working.
Upvotes: 5
Views: 18945
Reputation: 1764
Based on How to install and set up Neovim on Windows:
Like the error says, you need to install cc, gcc, clang or zig.
If you have choclatey installed:
choco install zig
Otherwise, you can install Zig directly from their website: https://ziglang.org/learn/getting-started/
Based on IT'S FOSS — What is Build Essential Package in Ubuntu? How to Install it?:
Install the essentials:
sudo apt update && sudo apt install build-essential
Run Neovim again and the error goes away.
Upvotes: 13
Reputation: 65
Tree-sitter needs to locate correct libraries such as "libstdc++-6.dll" among others. Such dll files are included in Neovim directory. To ensure that Tree-sitter correctly locates correct version of libraries, modify your system's Path environment variable so that the path to Neovim is above other paths that might have dll files.
To do that, follow the instructions below:
sysdm.cpl ,3
Path
variable with some values in it.Path
variable:TSUpdate all
inside Neovim to recompile Tree-sitter parsers.Upvotes: 3