E903: Process failed to start: no such file or directory: "/home/****/.local/share/nvim/plugged/markdown-preview.nvim/app/bin/markdown-preview-linux"
Describe the bug When I run MarkdownPreview I get the following error:
Error detected while processing function mkdp#util#open_preview_page[6]..mkdp#rpc#start_server:
line 31:
E903: Process failed to start: no such file or directory: "/home/dot/.local/share/nvim/plugged/markdown-preview.nvim/app/bin/markdown-preview-linux"
To Reproduce Steps to reproduce the behavior:
- Install via vim-plug in NVIM v0.5.0
- Run MarkdownPreview in an open markdown file
Expected behavior A Markdown Preview is shown
Desktop (please complete the following information):
- OS: NixOS 21.11 (Porcupine)
Are you using the "no node or yarn" option to install?
Short solution: make node and yarn available to your environment (e.g. edit /nixos/configuration.nix, use home-manager, or just nix-env -i). The package names are nixpkgs.nodejs and nixpkgs.yarn. Then install the plugin via the node and yarn option. This should make the plugin run normally.
Long explanation: in the case of missing node or yarn, the install process will download a prebuilt binary onto the machine. Navigate to the path it prompt, you can actually see the file is there.
$ ldd markdown-preview-linux
This will show that some dynamically linked libraries cannot be found, which is the expected behavior on NixOS. Specifically, the missing binary interpreter will cause the "file not found" error.
You can, of course, manually patch them, but often the node interpreter cannot interpret the script. See #168 . There are some mentioned efforts to build it with nix, but before that is available, you can always use the node and yarn option to get it up and running.
Also after using patchelf --set-interpreter $(patchelf --print-interpreter `which cp`) .local/share/lunarvim/site/pack/lazy/opt/markdown-preview.nvim/app/bin/markdown-preview-linux I got error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory