iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.76k stars 280 forks source link

E117: Unknown function: mkdp#util#install #50

Closed serend1p1ty closed 5 years ago

serend1p1ty commented 5 years ago

安装插件的时候报错:

Post-update hook for markdown-preview.nvim ... Vim(return):E117: Unknown function: mkdp#util#install

vim是官网最新build的版本。https://github.com/vim/vim-win32-installer/releases 系统:win10

iamcco commented 5 years ago

你用什么插件管理插件安装的?还有用的什么命令?如果是vim-plug 试试升级 vim-plug 本身试下

serend1p1ty commented 5 years ago

@iamcco 谢谢您的回复。 已经是最新的vim-plug了。 vimrc里面的命令是

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

这个报错很奇怪,不是安装失败,而是根本找不到这个命令。

iamcco commented 5 years ago

'for': 'markdown'去掉看看

iamcco commented 5 years ago

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

serend1p1ty commented 5 years ago

@iamcco 现在电脑不在身边了,明天我尝试下。谢谢你了。

serend1p1ty commented 5 years ago

@iamcco 我借了别人电脑试了一下,果然是vim-plug中for语法的问题。写成

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

就可以了。 真神奇,for不是控制一个插件安装之后是否加载它吗?按理说插件还未安装的时候,for应该是没用的呀。

iamcco commented 5 years ago

hook 是安装完调用的

serend1p1ty commented 5 years ago

了解,感谢。

jdhao commented 5 years ago

我也遇到了类似的问题,使用的是 vim-plug,奇怪的是之前使用

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

是没有问题的,最近才出现这个问题。

iamcco commented 5 years ago

@jdhao

是不是加了 for markdown,需要加上 vim-plug

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

我加上 vim-plug,好像也有点问题,后来全部去了,就可以正常安装了。。

iamcco commented 5 years ago

加上 vim-plug 是啥问题?

jdhao commented 5 years ago

我刚才重新测试了一下,加上 vim-plug 没问题,之前有问题,可能是我安装插件以后没有重启 Neovim 导致的。

akinsho commented 4 years ago

Is it worth adding this fix to the README.md? happy to make that change if you agree was having this issue for months before I found this issue

iamcco commented 4 years ago

@Akin909 looks good to me.

StarryLeo commented 4 years ago

This may be caused by post-update hook bug of vim-plug, see https://github.com/junegunn/vim-plug/issues/964, after fixed, the following line

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

should work fine without adding 'for': 'vim-plug'. Before fixed, I have been using

Plug 'iamcco/markdown-preview.nvim', { 'do': ':call mkdp#util#install()', 'for': 'markdown' }

which also is supposed by vim-plug to solve this problem.

akinsho commented 4 years ago

I just tried removing vim-plug from the for and hit the same error as before, and I'm on the latest vim plug version :cry:

ACupofAir commented 4 years ago

我在win10下gvim8.2按教程配置了默认.vimrc后还是报错 image

这是我的插件配置文件: image

gemini4545 commented 3 years ago

我在win10下gvim8.2按教程配置了默认.vimrc后还是报错 image

这是我的插件配置文件: image

也是win10,vim8.2。一样的症状,报错: [vim-node-rpc] pre build and node not found! Pre build and node is not found

yzymickey commented 3 years ago

Invalid expression: > mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}) what is this?

junshoong commented 3 years ago

Thanks! it's works for me ~/.vimrc

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

then, :call mkdp#util#install()

Crazyokd commented 2 years ago

Consider using the plug-in manager to see if the plug-in has been successfully installed.

diamondburned commented 1 year ago

I'm still getting this error with both

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

and

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

I should be on latest vim-plug.

The full error is:

x Post-update hook for markdown-preview.nvim ... Vim(call):E117: Unknown function: mkdp#util#install

Edit: I ended up installing this through Nix and skipping vim-plug altogether.

cocoliliace commented 1 year ago

I am getting this error as well. I can get past it by running :call mkdp#util#install() manually, but then it says

E903: Process failed to start: no such file or directory: "/home/elaina/.vim/plugged/markdown-preview.nvim/app/bin/markdown-preview-linux"

even though the file is there, with execute permission.

m-danya commented 1 year ago

None of the solutions above helped me, so I just switched to the second option of installing this plugin from the README — by installing npm (here I install it via nvm) and yarn:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install stable
nvm use stable
npm install -g yarn

with this line in my vim config:

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

I'm still getting the same error but can solve this by manually calling :call mkdp#util#install() as @cocoliliace mentioned above.