Repository: neovim/neovim
File: runtime/lua/vim/provider/health.lua (Lua)

Code before:
    health.warn('Missing "neovim" npm (or yarn, pnpm) package.', {
      'Run in shell: npm install -g neovim',
      'Run in shell (if you use yarn): yarn global add neovim',
      'Run in shell (if you use pnpm): pnpm install -g neovim',
      'You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim',
    })
    return
  end
  health.info('Nvim node.js host: ' .. host)

  local manager = 'npm'
  if vim.fn.executable('yarn') == 1 then
    manager = 'yarn'
  elseif vim.fn.executable('pnpm') == 1 then
    manager = 'pnpm'
  end

  local latest_npm_cmd = (
    iswin and { 'cmd', '/c', manager, 'info', 'neovim', '--json' }
    or { manager, 'info', 'neovim', '--json' }
  )
  local latest_npm
  ok, latest_npm = cmd_ok(latest_npm_cmd)
  if not ok or latest_npm:find('^%s$') then
    health.error(
      'Failed to run: ' .. table.concat(latest_npm_cmd, ' '),
      { "Make sure you're connected to the internet.", 'Are you behind a firewall or proxy?' }
    )
    return
  end

  local pcall_ok, pkg_data = pcall(vim.json.decode, latest_npm)
  if not pcall_ok then
    return 'error: ' .. latest_npm
  end
  local latest_npm_subtable = pkg_data['dist-tags'] or {}
  latest_npm = latest_npm_subtable['latest'] or 'unable to parse'

  local current_npm_cmd = { 'node', host, '--version' }
  local current_npm
  ok, current_npm = cmd_ok(current_npm_cmd)
  if not ok then
    health.error(
      'Failed to run: ' .. table.concat(current_npm_cmd, ' '),
      { 'Report this issue with the output of: ', table.concat(current_npm_cmd, ' ') }
    )
    return
  end

  if latest_npm ~= 'unable to parse' and vim.version.lt(current_npm, latest_npm) then
    local message = 'Package "neovim" is out-of-date. Installed: '

Review comment (bug):
shellify exists for this. please check other cases too.

```suggestion
      'Failed to run: ' .. shellify(latest_npm_cmd, ' '),
```

Code after:
    health.warn('Missing "neovim" npm (or yarn, pnpm) package.', {
      'Run in shell: npm install -g neovim',
      'Run in shell (if you use yarn): yarn global add neovim',
      'Run in shell (if you use pnpm): pnpm install -g neovim',
      'You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim',
    })
    return
  end
  health.info('Nvim node.js host: ' .. host)

  local manager = 'npm'
  if vim.fn.executable('yarn') == 1 then
    manager = 'yarn'
  elseif vim.fn.executable('pnpm') == 1 then
    manager = 'pnpm'
  end

  local latest_npm_cmd = (
    iswin and { 'cmd', '/c', manager, 'info', 'neovim', '--json' }
    or { manager, 'info', 'neovim', '--json' }
  )
  local latest_npm
  ok, latest_npm = cmd_ok(latest_npm_cmd)
  if not ok or latest_npm:find('^%s$') then
    health.error(
      'Failed to run: ' .. shellify(latest_npm_cmd),
      { "Make sure you're connected to the internet.", 'Are you behind a firewall or proxy?' }
    )
    return
  end

  local pcall_ok, pkg_data = pcall(vim.json.decode, latest_npm)
  if not pcall_ok then
    return 'error: ' .. latest_npm
  end
  local latest_npm_subtable = pkg_data['dist-tags'] or {}
  latest_npm = latest_npm_subtable['latest'] or 'unable to parse'

  local current_npm_cmd = { 'node', host, '--version' }
  local current_npm
  ok, current_npm = cmd_ok(current_npm_cmd)
  if not ok then
    health.error(
      'Failed to run: ' .. shellify(current_npm_cmd),
      { 'Report this issue with the output of: ', shellify(current_npm_cmd) }
    )
    return
  end

  if latest_npm ~= 'unable to parse' and vim.version.lt(current_npm, latest_npm) then
    local message = 'Package "neovim" is out-of-date. Installed: '