1

I am currently trying to install the LazyVim package manager. My NeoVim version is: v0.8.3. My Lua version is Lua 5.4.4. When I follow the installation steps, I get the following error:

Error detected while processing /home/eugen/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /home/eugen/.config/nvim/lua/config/lazy.l
ua:9: module 'lazy' not found:
        no field package.preload['lazy']
        no file './lazy.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-be
ta3/lazy.lua'
        no file '/usr/local/share/lua/5.1/lazy.lua'
        no file '/usr/local/share/lua/5.1/lazy/init.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/lazy.lu
a'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/lazy/in
it.lua'
        no file './lazy.so'
        no file '/usr/local/lib/lua/5.1/lazy.so'
        no file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/lazy.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        /home/eugen/.config/nvim/lua/config/lazy.lua:9: in main chunk
        [C]: in function 'require'
        /home/eugen/.config/nvim/init.lua:2: in main chunk
Press ENTER or type command to continue

I have tried installing lazy.nvim multiple times already in multiple ways and it doesn't work. It says that lazy.lua is missing every time.

romainl
  • 186,200
  • 21
  • 280
  • 313

3 Answers3

2

Removing ~/.local/share/nvim/lazy works. When first installing, don't close the shell when seeing a black screen. If you do, you'll have the exact problem I had when installing it again

1

You need to write installation code

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  -- bootstrap lazy.nvim
  -- stylua: ignore
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

in init.lua under .config/nvim

Ryou
  • 11
  • 1
-1

You might be using a version of git that is too old and doesn't have the "--filter=blob:none" option. In that case, the installation might fail silently. Try to update git or see if you can manually execute the git clone command to confirm this:

git clone --filter=blob:none https://github.com/folke/lazy.nvim.git --branch=stable
user15546
  • 46
  • 6