From 7fd0f541e7c7a6a41acf13e72cc0dba9b4d68e2a Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Sat, 4 Jul 2026 15:10:55 -0500 Subject: [PATCH] fix(health): don't check node package via yarn #40572 (cherry picked from commit 1aced004cef1aa8148f2c6c9d3311298b3b91fc5) --- runtime/lua/vim/provider/health.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/runtime/lua/vim/provider/health.lua b/runtime/lua/vim/provider/health.lua index 00f3aba45c..d7fac941f6 100644 --- a/runtime/lua/vim/provider/health.lua +++ b/runtime/lua/vim/provider/health.lua @@ -209,13 +209,20 @@ local function node() end health.info('Nvim node.js host: ' .. host) - local manager = 'npm' - if vim.fn.executable('yarn') == 1 then - manager = 'yarn' + -- only npm/pnpm query the registry here: `yarn info` errors outside a + -- project on yarn 2+ (#20924), and bun isn't used for this check. + local manager --- @type string? + if vim.fn.executable('npm') == 1 then + manager = 'npm' elseif vim.fn.executable('pnpm') == 1 then manager = 'pnpm' end + if not manager then + health.info('Skipping latest "neovim" package check: npm or pnpm not in $PATH.') + return + end + local latest_npm_cmd = { manager, 'info', 'neovim', '--json' } local latest_npm ok, latest_npm = cmd_ok(latest_npm_cmd)