coc-ccls icon indicating copy to clipboard operation
coc-ccls copied to clipboard

Unable to load global extension

Open Notaduck opened this issue 4 years ago • 12 comments

Observed behavio

Every time I open neovim do I get greeted by the following message:

[coc.nvim] Unable to load global extension at /home/daniel/.config/coc/extensions/node_modules/coc-ccls: main
 file ./lib/extension.js not found, you may need to build the project.

Steps to reproduce

I installed coc-ccls with CocInstall <package name>, edited my config

{
	"coc.preferences.formatOnSaveFiletypes": ["js", "jsx"],
	"eslint.run": "onType",
	"eslint.autoFix": true,
	"languageserver": {
			"ccls": {
				"command": "ccls",
				"filetypes": ["c", "cpp", "objc", "objcpp"],
				"rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
				"initializationOptions": {
					 "cache": {
						 "directory": "/tmp/ccls"
					 }
				 }
			}
		},
    "java.home": "/usr/lib/jvm/java-11-openjdk/",
    "java.format.settings.url": "/home/daniel/.config/coc/extensions/node_modules/redhat.java/eclipse-formatter.xml"

}

I've tried to update, rebuild, reinstall the plugin without any luck.

Notaduck avatar Sep 16 '20 06:09 Notaduck

If you want to remove that warning altogether, you could delete the coc/ folder in ~/.config and you can reinstall the plugins.

You could actually go in and delete the specific files or text to make it go away but I have a script in place to download a set of default extensions from Coc on Startup.

ferran9908 avatar Nov 18 '20 07:11 ferran9908

uninstalling coc-ccls and removing coc-ccls directory does not help

CapSel avatar Nov 26 '20 14:11 CapSel

I am having the same issue, and reinstalling the extension does not seem to work for me either. I do not know what the file lib/extension.js could be, as it is not present in the extension.

tarsiec avatar Dec 26 '20 22:12 tarsiec

I'm also running into this problem.

Tkdefender88 avatar Jan 09 '21 04:01 Tkdefender88

cd ~/.config/coc/extensions/node_modules/coc-ccls ln -s node_modules/ws/lib lib

Does this work for you ?

DannMartinnez avatar Jan 25 '21 23:01 DannMartinnez

I am currently not with my Linux laptop so I am sorry that I can't test it now.

Notaduck avatar Jan 26 '21 06:01 Notaduck

It fixed the issue for me at least.

davepinto avatar Jan 28 '21 12:01 davepinto

For me - the problem here was that the extensions.json file referenced extensions I had long uninstalled. Removing the references to the extensions I no longer had installed in extensions.json fixed it for me.

DarrienG avatar Feb 18 '21 01:02 DarrienG

cd ~/.config/coc/extensions/node_modules/coc-ccls ln -s node_modules/ws/lib lib

Does this work for you ?

i think your way is the best way

yegetables avatar Apr 01 '21 11:04 yegetables

cd ~/.config/coc/extensions/node_modules/coc-ccls ln -s node_modules/ws/lib lib

Does this work for you ?

it does work for me with this issues

zzLinus avatar Aug 10 '21 09:08 zzLinus

cd ~/.config/coc/extensions/node_modules/coc-ccls ln -s node_modules/ws/lib lib

Does this work for you ?

This worked for me as well. Thanks!

b3ll9trix avatar Jun 12 '22 12:06 b3ll9trix

cd ~/.config/coc/extensions/node_modules/coc-ccls ln -s node_modules/ws/lib lib

Does this work for you ?

Yes, but can we talk about this? Can we not have to do this, yanno, new $machine and not remembering?

What's the actual reason for needing to do this?


Ah, from: https://github.com/neoclide/coc.nvim/issues/2088#issuecomment-974727778

cd ~/.config/coc/extensions/node_modules/coc-ccls
npm i
npm run build

After building you'll have this lib. Cool.

Though, would be rad if :CocInstall coc-ccls performed these same steps.

shmup avatar Jul 21 '22 02:07 shmup