Open miguelbarao opened 11 months ago
same issue, check #612
It is impossible to solve if you use npm
as the installer due to this open issue: https://github.com/npm/cli/issues/5126
So, I think you should not mention npm
as an installation method in the README: https://github.com/iamcco/markdown-preview.nvim/blob/a923f5fc5ba36a3b17e289dc35dc17f66d0548ee/README.md?plain=1#L109
The commands that should work property are
cd app && npx --yes yarn install
cd app && npm install && rm -f package-lock.json && git restore .
It is impossible to solve if you use
npm
as the installer due to this open issue: npm/cli#5126So, I think you should not mention
npm
as an installation method in the README:The commands that should work property are
* `cd app && npx --yes yarn install` * `cd app && npm install && rm -f package-lock.json && git restore .`
what works for now is:
local job = require("plenary.job")
local install_path = vim.fn.stdpath("data") .. "/lazy/markdown-preview.nvim/app"
local cmd = "bash"
if vim.fn.has("win64") == 1 then
cmd = "pwsh"
end
job
:new({
command = cmd,
args = { "-c", "npm install && git restore ." },
cwd = install_path,
on_exit = function()
print("Finished installing markdown-preview.nvim")
end,
on_stderr = function(_, data)
print(data)
end,
})
:start()
-- Options
vim.g.mkdp_auto_close = 0
Describe the bug
Using lazy package manager. Since a few weeks, markdown-preview installed with npm gives an error message:
I have to manually uninstall and reinstall every time this error appears. Maybe this yarn.lock file shouldn't be tracked by git?
To Reproduce
Use the follow config in lazy:
Desktop (please complete the following information):