Closed ashincoder closed 3 years ago
If packer can't find it then you need to add it to package.path
.
Also make sure packer is a start
plugin and not an opt
plugin as it needs to be available when impatient runs.
how can I add to package.path. Is it a specific directory or something. My packer is a start plugin
It is a Lua variable.
yeah so mpack is installed in lua/5.4. But require"mpack" is looking in lua/5.1. So how can I install it to 5.1. ?
I strongly recommend to use the packer functionality for adding luarock dependencies -- it was created specifically to handle this Lua version dependence for you.
If a packer-installed rocks dependency isn't found by a plugin, this is a packer issue -- you should check their repo for open issues or ask in their Gitter.
Oh ok thx. here is what I added to install.
use {
"lewis6991/impatient.nvim",
rocks = "mpack",
}
Sounds like a Packer issue, then.
Hmm, could also be that packer sets up the packagage.path
too late in the startup sequence (you need to require 'impatient'
before any packages, so before packer
(and its compiled loader) itself.
In this case, you can't use packer for installing mpack
. To specify a version for luarocks
, you need to add the --lua-version
option:
luarocks --lua-version=5.1 install mpack
(Or, better, build neovim from source with mpack
included.)
yes this did work. I had to do sudo luarocs --lua-version=5.1 install mpack
Thank @lewis6991 @clason for u help and patience. Have a nice day :+1: :smile:
I also had this problem, and it wasn't enough for me to do sudo luarocks --lua-version=5.1 install mpack
. Turns out Neovim doesn't read the ~/.luarocks/lib/lua/5.1
directory (where luarocks are stored by default). Move mpack.so
from ~/.luarocks/lib/lua/5.1
into any of the directories listed if you get this error message:
I put mpack.so
in /usr/local/lib/lua/5.1
and it worked just fine.
You can to point LuaJIT to the luarocks
by adding the corresponding directory to package.path
(which is a global variable).
I have install mpack using luarocks. I did it the packer way. I did the manually using luarocks --local install mpack and also the with sudo. But it doesn't work ?