neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.43k stars 954 forks source link

[coc.nvim] Can't load extension from "/home/user/.config/nvim": package.json not found in: /home/user/.config/nvim #1941

Closed voldikss closed 4 years ago

voldikss commented 4 years ago

Result from CocInfo

## versions

vim version: NVIM v0.5.0-d7d69fe
node version: v14.2.0
coc.nvim version: 0.0.78
term: xterm-256color
platform: linux

Describe the bug

After 14623e1ca36254fc9271c3bf20a60fe92aa2f0bd, every time when I use :Startify coc throws the following messages:

[coc.nvim] Can't load extension from "/home/user/.config/nvim": package.json not found in: /home/user/.config/nvim
[coc.nvim] Can't load extension from "/usr/share/vim/vimfiles": package.json not found in: /usr/share/vim/vimfiles
[coc.nvim] Can't load extension from "/home/user/.cache/nvim/plugged/yats.vim": can't find name & engines in /home/user/.cache/nvim/plugged/yats.vim/package.json
...

I put all my coc extension only in ~/.config/coc, the directory ~/.cache/nvim/plugged is only used for vim plugins(coc.nvim, vim-startify, etc.). Coc shouldn't look for coc extensions from my vim plugins location.

Reproduce the bug

Possible causes

Might be caused by the following lines

https://github.com/neoclide/coc.nvim/blob/9704f8d076426177dcbd92067dc76bafa266f852/src/extensions.ts#L102-L111

Since I use lazy loading provided by vim-plug. Once I use :Startify, vim-plug adds vim-startify path to &runtimepath. Once the runtimepath was changed, that event got fired and coc began to loadExtension from one of my &runtimepath...

But I don't know how to fix it. I disabled this line for a temporary fix. https://github.com/neoclide/coc.nvim/blob/9704f8d076426177dcbd92067dc76bafa266f852/src/extensions.ts#L452 Please help.

sQVe commented 4 years ago

I'm still getting the exact same output when running :PlugUpdate. Running the latest from master.

chemzqm commented 4 years ago

Sorry, bad commit.

tombh commented 4 years ago

I'm still seeing this with latest commit de70457

chemzqm commented 4 years ago

@tombh you didn't compile the code.

tombh commented 4 years ago

I've done yarn install --frozen-lockfile, is there something else I need to do?

chemzqm commented 4 years ago

@tombh rm -rf build

tombh commented 4 years ago

Thank you. Sorry about this. I removed the entire ~/.config/nvim/plugged/coc.nvim folder, ran yarn install --frozen-lockfile and I still see the same error messages on neovim boot.

Edit: of course I ran git clone after removing the coc.nvim folder

chemzqm commented 4 years ago

I will make some change to avoid this issue, this could be happened after switch branch of coc.nvim.

chemzqm commented 4 years ago

Checkout coc.nvim version by :CocInfo looks like your activated coc.nvim is not what you just downloaded.

tombh commented 4 years ago

Thank you. I get this:

vim version: NVIM v0.4.3
node version: v12.16.1
coc.nvim version: 0.0.78
coc.nivm directory: /home/tombh/.config/nvim/plugged/coc.nvim
term: screen-256color
platform: linux

And still after recent updates I get all the [coc.nvim] Can't load extension from "/home/user/.config/nvim": package.json not found in: /home/user/.config/nvim errors in status, that I need to press Enter on multiple times. Edit: My error is different! I'm so sorry for not noticing sooner. My errors are like this: [coc.nvim] Can't load global extension from "/home/tombh/.config/coc/extensions/node_modules/coc-json": package.json not found

chemzqm commented 4 years ago

You have to reinstall your broken extension

tombh commented 4 years ago

Ok. How did I break them?

chemzqm commented 4 years ago

I don't know

kadadot216 commented 4 years ago

I had the same message until I deleted my ~/.config/coc folder.

semanser commented 3 years ago

Check permissions on your folders. In my case, this error was caused by an incorrect chmod.

mkdior commented 2 years ago

Check permissions on your folders. In my case, this error was caused by an incorrect chmod.

++, at least, my .vim folder and others were owned by system. Had to change the ownership of my .vim folder to my user. Everything after that went smoothly.