The issue is that nothing happens except printing nodejs version when running MarkdownPreview command. The reason is. automatic install doesn’t work. This is how I fixed.

You need to add this to plugins/markdown.lua, or create it if you don’t have it.

return {
  {
    "iamcco/markdown-preview.nvim",
    cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
    build = "cd app && npm install", // if you prefer `yarn`, replace `npm` with `yarn`
    init = function()
      vim.g.mkdp_filetypes = { "markdown" }
    end,
    ft = { "markdown" },
  },
}

and then run these commands to install manually,

cd ~/.local/share/nvim/lazy/markdown-preview.nvim/app
./install.sh

You will be able to see markdown preview on the browser.


discussion