mawkler / modicator.nvim

Cursor line number mode indicator plugin for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

module 'modicator' not found

Asthestarsfalll opened this issue · comments

I use packer to install modicator, but it does't work well
image
image

module 'modicator' not found:\n\tno field package.preload['modicator']\n\tno file './modicator.lua'\n\tno file '/usr/share/luajit-2.1.0-beta3/mo
dicator.lua'\n\tno file '/usr/local/share/lua/5.1/modicator.lua'\n\tno file '/usr/local/share/lua/5.1/modicator/init.lua'\n\tno file '/usr/share/lua/5.1/modicator.lua'\n\tno file '/usr/share/lua/5.1/modicator/init.lua'\n\tno file
'./modicator.so'\n\tno file '/usr/local/lib/lua/5.1/modicator.so'\n\tno file '/usr/lib/lua/5.1/modicator.so'\n\tno file '/usr/local/lib/lua/5.1/loadall.so'" file="init.lua", line=129

Hi @Asthestarsfalll! I'm assuming that you're using zephyr-nvim. Packer's after should be set to the name of the repository, not the Lua module. Changing after = 'zephyr' to after = 'zephyr-nvim' solves the issue for me. Here's the config:

vim.opt.termguicolors = true

use { 'glepnir/zephyr-nvim',
  config = function()
    require('zephyr')
  end
}
use { 'melkster/modicator.nvim',
  after = 'zephyr-nvim', -- Change to this
  config = function()
    require('modicator').setup()
  end
}

Let me know if this solves your issue!

P.S. Next time, please post your code as text rather than as a screenshot to ease debugging :)

Thank you for reply !
But it seems that lvim still can not find the modicator.
I use LunarVim instead of neovim, maybe it's the reason of this issue?
The warnings are:

[WARN ] lvim: "Invalid configuration: /home/czh/.config/lvim/config.lua:273: module 'modicator' not found:\n\tno field package.preload['modicator']\n\t
no file './modicator.lua'\n\tno file '/usr/share/luajit-2.1.0-beta3/modicator.lua'\n\tno file '/usr/local/share/lua/5.1/modicator.lua'\n\tno file '/usr/local/sh
are/lua/5.1/modicator/init.lua'\n\tno file '/usr/share/lua/5.1/modicator.lua'\n\tno file '/usr/share/lua/5.1/modicator/init.lua'\n\tno file './modicator.so'\n\t
no file '/usr/local/lib/lua/5.1/modicator.so'\n\tno file '/usr/lib/lua/5.1/modicator.so'\n\tno file '/usr/local/lib/lua/5.1/loadall.so'" file="init.lua", line=1
29

packer.nvim: Error running config for modicator.nvim: [string "..."]:0: module 'modicator' not found:
^Ino field package.preload['modicator']
^Ino file './modicator.lua'
^Ino file '/usr/share/luajit-2.1.0-beta3/modicator.lua'
^Ino file '/usr/local/share/lua/5.1/modicator.lua'
^Ino file '/usr/local/share/lua/5.1/modicator/init.lua'
^Ino file '/usr/share/lua/5.1/modicator.lua'
^Ino file '/usr/share/lua/5.1/modicator/init.lua'
^Ino file '/home/czh/.cache/lvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/modicator.lua'
^Ino file '/home/czh/.cache/lvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/modicator/init.lua'
^Ino file '/home/czh/.cache/lvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/modicator.lua'
^Ino file '/home/czh/.cache/lvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/modicator/init.lua'
^Ino file './modicator.so'
^Ino file '/usr/local/lib/lua/5.1/modicator.so'
^Ino file '/usr/lib/lua/5.1/modicator.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
[packer.nvim] [ERROR 22:06:53] async.lua:20: Error in coroutine: ...ite/pack/packer/start/packer.nvim/lua/packer/compile.lua:612: Dependency zephyr for { "modic
ator.nvim" } not found

@Asthestarsfalll It sounds to me like an issue with packer.nvim and/or LunarVim and/or how you've configured them. It's difficult for me to help you further I'm afraid but you could try to use requires instead of after, perhaps that fixes the issue?:

use { 'melkster/modicator.nvim',
  requires = 'glepnir/zephyr-nvim',
  config = function()
    require('modicator').setup()
  end
}

Thank you very much!
I change the way of adding zephyr
before:

lvim.plugins = {
  ...
  {'glepnir/zephyr-nvim'}
}

after:

lvim.plugins = {
  ...
  { 'glepnir/zephyr-nvim',
    config = function()
      require('zephyr')
    end
  }
}

Then it works!