You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows系统下Lunar VIM的YAML解析器加载失败问题

解决Treesitter YAML/HTML解析器uv_dlopen加载失败问题

问题现象

每次打开包含YAML的项目时触发以下错误:

Error executing vim.schedule lua callback: Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.

堆栈跟踪

[C]: in function '_ts_add_language'
...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:99: in function 'add'
...m/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:98: in function 'new'
...m Files/Neovim/share/nvim/runtime/lua/vim/treesitter.lua:61: in function '_create_parser'
...m Files/Neovim/share/nvim/runtime/lua/vim/treesitter.lua:131: in function 'get_parser'
...zy/opt/telescope.nvim/lua/telescope/previewers/utils.lua:141: in function 'ts_highlighter'
...zy/opt/telescope.nvim/lua/telescope/previewers/utils.lua:119: in function 'highlighter'
...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:244: in function 'cb'
vim/_editor.lua:263: in function <vim/_editor.lua:262>

Treesitter健康检查结果

Nvim runtime ABI version: 14
OK Parser: comment    ABI: 13, path: C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\comment.so
ERROR Parser "html" failed to load (path: C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\html.so): Failed to load parser for language 'html': uv_dlopen: The specified procedure could not be found.

OK Parser: json       ABI: 14, path: C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\json.so
OK Parser: lua        ABI: 13, path: C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\lua.so
OK Parser: markdown_inline ABI: 13, path: C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\markdown_inline.so
OK Parser: regex      ABI: 13, path: C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\regex.so
OK Parser: tsx        ABI: 14, path: C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\tsx.so
OK Parser: typescript ABI: 14, path: C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\typescript.so
ERROR Parser "yaml" failed to load (path: C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\yaml.so): Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.

OK Parser: c          ABI: 13, path: C:\Program Files\Neovim\lib\nvim\parser\c.dll
OK Parser: lua        ABI: 13, path: C:\Program Files\Neovim\lib\nvim\parser\lua.dll
OK Parser: query      ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\query.dll
OK Parser: vim        ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\vim.dll
OK Parser: vimdoc     ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\vimdoc.dll

已尝试的无效操作

  • 安装clang
  • 卸载并重新安装LunarVim
  • 重启计算机
  • 执行TSInstall yaml手动安装解析器
  • 修改lua配置文件

解决方案

该问题多因解析器ABI版本不匹配、预编译文件依赖缺失导致,按以下步骤操作:

  1. 删除现有问题解析器
    手动删除路径 C:\Users\juanc\AppData\Roaming\lunarvim\site\pack\lazy\opt\nvim-treesitter\parser\ 下的 yaml.so 和 html.so 文件。

  2. 从源码强制编译解析器
    在LunarVim中执行命令,强制从源码编译对应解析器:

    :TSInstallFromSource yaml html
    

    注意:需提前安装Git和Rust环境(Cargo),YAML解析器依赖Rust编译。若未安装Rust,直接下载官方安装程序并勾选"Add Rust to PATH"选项。

  3. 验证修复结果
    执行健康检查命令确认解析器状态:

    :checkhealth vim.treesitter
    

    查看yaml和html解析器状态是否变为OK。

  4. 仍未解决的补充操作

    • 更新nvim-treesitter插件:执行 :Lazy update nvim-treesitter
    • 重复步骤1-3重新编译解析器

内容的提问来源于stack exchange,提问作者Juan Colchete

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 15:12:00