iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.74k stars 278 forks source link

Apple M1(Big Sur )上:MarkdownPreview 没反应 #319

Open LouisU opened 3 years ago

LouisU commented 3 years ago

MacOS Big Sur 11.2 版本

  1. Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} 这种方式安装成功。
  2. 添加了README config中的设置,没有任何变化。
  3. 进入到md文件运行:MarkdownPreview 没有任何反应。
  4. 设置 nmap MarkdownPreview, 然后在md文件中按F8,也没有任何反应。
Qiguang commented 3 years ago

in vim command mode, try this 2 commands

:MarkdownPreview :messages

to see if there are any error logs, and if so, put them here please.

I guess this has nothing to do with M1, maybe caused by nodejs issues.

navazjm commented 3 years ago

@Qiguang I used your two commands and this the error I am getting. Hope this helps. Edit: I am on Apple M1 with MacOS Big Sur 11.4

Screen Shot 2021-06-11 at 10 11 18 PM
nothankyouzzz commented 3 years ago

MacOS Big Sur 11.2 版本

  1. Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} 这种方式安装成功。
  2. 添加了README config中的设置,没有任何变化。
  3. 进入到md文件运行:MarkdownPreview 没有任何反应。
  4. 设置 nmap MarkdownPreview, 然后在md文件中按F8,也没有任何反应。

First of all, you should check whether you have installed the yarn and node js or not, and then, you can try to uninstall your plugin and reinstall it again. It works on myself :)

itsjunetime commented 3 years ago

I ran into this same issue (saw the same Cannot find module 'tslib') and solved it by:

  1. Install the plugin normally
  2. cd into the plugin directory (e.g. cd ~/.config/nvim/plugins/markdown-preview.nvim)
  3. Running yarn install && yarn upgrade

Everything should work just as expected after that

richtong commented 2 years ago

Yes there is a documentation fix that seems to be required on the M1 Mac, I've tried both the installation in the README.md, that is

The documentation says that this should work and I get the error that this function is not found

Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}

But this line does not work reliably. What I found I had to do was add this and then you have to make sure that it executes properly. If it doesn't delete the line run source % and then PLugClean and then PlugInstall! which is force run of the post installer, the cd app and then yarn install seems to work :-)

Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app &&  yarn install'        }
talkingtab commented 1 year ago

I have an non-silicon mac, running 10.14 and had this error. I did the @iandwelker thing (thanks) and it worked for me. I'm using plugged so cd ~/.vim/plugged/etc. So not a silicon issue, nor a plug manager to the best of my understanding.

Did :messages and got this:

[vim-node-rpc] rpc error: (node:5994) Warning: Accessing non-existent property 'padLevels' of modul e exports inside circular dependency [vim-node-rpc] rpc error: (Use node --trace-warnings ... to show where the warning was created) (node:5995) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created)

sugiura-hiromichi commented 1 year ago

I have similar issue on m1 MBA with macOS 13.3.1.

here is error message

Error detected while processing function mkdp#util#open_preview_page[6]..mkdp#rpc#start_server:

E903: Process failed to start: Unknown system error -86: "/Users/e/.local/share/nvim/lazy/markdown-preview.nvim/app/bin/markdown-preview-macos"
MannyFay commented 1 year ago

I'm on a MacBook Air M1 with Neovim and Packer plugin manager. I've followed the steps in the README.md.

In my plugins.lua I've set it up like this:

use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })

Then I clone the repo like the README.md says. If I run yarn build, I run into this error:

yarn run v1.22.19
warning ../../../../../../../../package.json: No license field
$ tsc -p ./ && cd app && rm -rf ./.next && next build && next export && yarn && pkg --targets node16-linux-x64,node16-macos-x64,node16-win-x64 --out-path ./bin . && rm -rf ./node_modules ./.next
[9:24:36 AM] Compiling client
[9:24:36 AM] Compiling server
[9:24:37 AM] Compiled server in 921ms
[9:24:50 AM] Compiled client in 14s
> using build directory: /Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/app/.next
(node:81656) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/emitter-mixin/package.json' of 'y'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
  copying "static build" directory
> exporting path: /
> exporting path: /404.html

Export successful
warning ../../../../../../../../../package.json: No license field
[1/4] 🔍  Resolving packages...
success Already up-to-date.
> pkg@5.8.1
node:internal/child_process:413
    throw errnoException(err, 'spawn');
    ^

Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at spawn (node:child_process:700:9)
    at fabricate (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/pkg/lib-es5/fabricator.js:55:51)
    at fabricateTwice (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/pkg/lib-es5/fabricator.js:120:5)
    at MultiStream._queue (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/pkg/lib-es5/producer.js:271:68)
    at MultiStream._next (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/multistream/index.js:86:12)
    at Meter.onEnd (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/multistream/index.js:129:12)
    at Object.onceWrapper (node:events:641:28)
    at Meter.emit (node:events:527:28)
    at endReadableNT (node:internal/streams/readable:1345:12) {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
FAIL

None of the solutions here has worked. Is there any solution to this?

arauzca commented 1 year ago

I'm on a MacBook Air M1 with Neovim and Packer plugin manager. I've followed the steps in the README.md.

In my plugins.lua I've set it up like this:

use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })

Then I clone the repo like the README.md says. If I run yarn build, I run into this error:

yarn run v1.22.19
warning ../../../../../../../../package.json: No license field
$ tsc -p ./ && cd app && rm -rf ./.next && next build && next export && yarn && pkg --targets node16-linux-x64,node16-macos-x64,node16-win-x64 --out-path ./bin . && rm -rf ./node_modules ./.next
[9:24:36 AM] Compiling client
[9:24:36 AM] Compiling server
[9:24:37 AM] Compiled server in 921ms
[9:24:50 AM] Compiled client in 14s
> using build directory: /Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/app/.next
(node:81656) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/emitter-mixin/package.json' of 'y'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
  copying "static build" directory
> exporting path: /
> exporting path: /404.html

Export successful
warning ../../../../../../../../../package.json: No license field
[1/4] 🔍  Resolving packages...
success Already up-to-date.
> pkg@5.8.1
node:internal/child_process:413
    throw errnoException(err, 'spawn');
    ^

Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at spawn (node:child_process:700:9)
    at fabricate (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/pkg/lib-es5/fabricator.js:55:51)
    at fabricateTwice (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/pkg/lib-es5/fabricator.js:120:5)
    at MultiStream._queue (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/pkg/lib-es5/producer.js:271:68)
    at MultiStream._next (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/multistream/index.js:86:12)
    at Meter.onEnd (/Users/manny/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/node_modules/multistream/index.js:129:12)
    at Object.onceWrapper (node:events:641:28)
    at Meter.emit (node:events:527:28)
    at endReadableNT (node:internal/streams/readable:1345:12) {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
FAIL

None of the solutions here has worked. Is there any solution to this?

Have you found any solution yet? I've run into the same problem.

MannyFay commented 1 year ago

Yes, I use

-- Markdown preview:
-- Install Deno: brew install deno
use({
  'toppair/peek.nvim',
  run = 'deno task --quiet build:fast',
  config = function()
    require('user.plugin_options.peek')
  end,
})

My Neovim repo is public. There you can grab the configuration. ...and all my other Nvim configs ^^