10

I trying to build, yarn build but it shows me

yarn run v1.22.17
error Couldn't find a package.json file in "/home/darth/.config/nvim/plug-config"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
Darth Voyage
  • 103
  • 1
  • 1
  • 5

8 Answers8

16

I resolved the errby running the command below on nevoim.

:call coc#util#install()
takeaki-m
  • 163
  • 1
  • 4
9

The error is due to the fact that COC is missing some dependencies to function.

  • Navigate to the directory \nvim\plugged\coc.nvim
  • Use your package manager: npm install or yarn install

Restart your VIM or NEOVIM.

Matthew Rankin
  • 457,139
  • 39
  • 126
  • 163
OnlyZero
  • 99
  • 1
  • 4
6

You should run yarn install in coc.nvim directory.

fannheyward
  • 18,599
  • 12
  • 71
  • 109
2

use release branch if you dont want to build over and over again.

wij
  • 99
  • 1
  • 9
2

resolved on mac by npm install

check the correct path:

cd ~/.vim/bundle/coc.nvim . cd: no such file or directory: /Users/pawankumar/.vim/bundle/coc.nvim

cd ~/.vim/plugged/coc.nvim/

npm install

2

For anyone else who is also dumb like me you're supposed to go to C:\Users\user\Appdata\Local\nvim-data\plugged\coc.nvim\ because coc.nvim is a directory apparently. Then you run yarn install or npm install and that should install everything necessary for coc to run properly

1

On windows navigate to your C:\Users\user\AppData\Local\nvim-data\plugged\coc.nvim file and run yarn install

1
[ Update : 1st July 2023 ]
For anyone running WSL 2 following the below steps worked for me.
  • Go to your home path i.e type cd ~ & then install nodejs by entering $ sudo apt install nodejs
    • then check the node version using node -v

if your node version < 14 then follow the below:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
  • by performing the 3 commands you must be able to update node to the latest version, when you again do node -v you will see node is > v 14.

if node version > 14 then continue below

Now you need to make sure you have NPM / YARN installed in the path: ~/.local/share/nvim/plugged/coc.nvim usually coc.nvim is located here but in case if you cannot find it then there is an easy way:

  • go to home cd ~, then enter explorer.exe . this will open a file explorer of your WSL 2 file tree, on the search bar just enter coc.nvim & search for the location.

to install NPM / YARN we just need to enter sudo apt install npm or sudo apt install yarn

Note: installing YARN did not work for me, So I installed NPM (takes a few minutes to install)

after this i performed npm install in the same path & that's it.it fixed my error.


also please note that I encountered this error while installing some packages to customizing my neovim.
Anton
  • 11
  • 4