markdown-preview.nvim: i m getting ```status failed```, some ```yarn.lock``` problem
done
○ markdown-preview.nvim MarkdownPreview MarkdownPreviewStop MarkdownPreviewToggle markdown
You have local changes in `/home/daUnknownCoder/.local/share/nvim/lazy/markdown-preview.nvim`:
* app/yarn.lock
Please remove them to update.
You can also press `x` to remove the plugin and then `I` to install it again.
Describe the bug A clear and concise description of what the bug is.
um lazy doesnt update the plugin and it says status failed
Expected behavior A clear and concise description of what you expected to happen. um it should update
Desktop (please complete the following information):
- OS: linux
Config
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" },
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
config = function()
local install_path = vim.fn.stdpath("data") .. "/lazy/markdown-preview.nvim/app"
local node_modules = install_path .. "/node_modules"
if vim.fn.empty(vim.fn.glob(node_modules)) > 0 then
vim.cmd("!cd " .. install_path .. " && npm install")
end
vim.g.mkdp_auto_close = 0
end,
},
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 4
- Comments: 21
Commits related to this issue
- Update markdown-preview config function :green_heart: Installation/updates are now asynchronous thanks to plenary Includes a temporary fix for iamcco/markdown-preview.nvim#612 — committed to scottmckendry/Windots by scottmckendry 8 months ago
- Update markdown-preview config function :green_heart: Installation/updates are now asynchronous thanks to plenary Includes a temporary fix for iamcco/markdown-preview.nvim#612 [skip ci] Automated syn... — committed to scottmckendry/dots by scottmckendry 8 months ago
- fix(markdown-previwe): restore yarn.lock after intallation * see https://github.com/iamcco/markdown-preview.nvim/issues/612 for details — committed to BulaBula-zy/astronvim_template by BulaBula-zy 3 months ago
Check the commit above for an updated (temporary) fix for this. It’s asynchronous now so it won’t be blocking opening any markdown files and it also suppresses the big long output that comes from npm (which is benign anyway).
I’ve tested this on both Windows and Linux and it works as intended. Should be enough to keep the lazy.nvim warnings at bay until a permanent fix is in place.
This worked well for me.
I had:
And changed it to:
One uninstall & reinstall later, no more complaints.
+1 for u
I’ve found a slightly hacky workaround that may work for others. I’m not a web dev, so the yarn’s and the npm’s really don’t mean a whole lot to me.
Looking at the error message and the git status of the plugin directory, I can see
npm install
is making changes to tracked files, so every time lazy.nvim does a fetch, it’s returning this message because there are local changes.To fix this, I’ve added a
git restore .
to my install command, which resets the repo with the remote and stops lazy.nvim raising alarms when running updates. Here’s my current config:I’m getting something similar:
I think it has something to do with the
yarn
version on your machine.I tested using yarn
v3.6.4
(latest stable) andv4.0.0-rc.53
(latest canary).In both cases, running
yarn install
modifies the following files:index.js
package.json
yarn.lock
These files are tracked by the git repo, so that’s probably what’s blocking the update.
I did test with yarn
v1.22.19
(the latest 1.x version), and it did not change any tracked files.Workarounds
v1.22.19
of yarnLonger term - I have some ideas for the maintainers:
v1.x
of yarn for it to work properly.Thoughts?
this still doesnt work for me, the plenary is quite stable [for now]
This still works, will check out the new one snip soon, anyway, u should update the Readme so new users won’t find this error
I did a test with the following on my Linux machine and found nothing wrong with node.js v18.18 and npm v9.8.1.
Why not put
npm install
/yarn install
andgit restore
part in thebuild
property which is dedicated to the plugin post-installation or post-update. There seems no need to use a async job.ig @iamcco isnt available for now, and the issue seems to be resolved [for now] so i m closing this issue
@scottmckendry Creative solution!
I’m just curious, is there a reason for doing
npm install
instead ofyarn install
?tried this got this thing:
i m doin this for now:
ig @iamcco should check this out