Open rahulkp220 opened 1 year ago
Same problem here
macOS 12.6 (21G115)
NVIM v0.9.0; Build type: Release; LuaJIT 2.1.0-beta3
git version 2.39.2
Error detected while processing BufWritePost Autocommands for "plugins.lua":
E5108: Error executing lua ...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:110: module 'packer.luarocks' not found:
no field package.preload['packer.luarocks']
cache_loader: module packer.luarocks not found
cache_loader_lib: module packer.luarocks not found
no file './packer/luarocks.lua'
no file '/opt/homebrew/share/luajit-2.1.0-beta3/packer/luarocks.lua'
no file '/usr/local/share/lua/5.1/packer/luarocks.lua'
no file '/usr/local/share/lua/5.1/packer/luarocks/init.lua'
no file '/opt/homebrew/share/lua/5.1/packer/luarocks.lua'
no file '/opt/homebrew/share/lua/5.1/packer/luarocks/init.lua'
no file './packer/luarocks.so'
no file '/usr/local/lib/lua/5.1/packer/luarocks.so'
no file '/opt/homebrew/lib/lua/5.1/packer/luarocks.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './packer.so'
no file '/usr/local/lib/lua/5.1/packer.so'
no file '/opt/homebrew/lib/lua/5.1/packer.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:110: in function 'require_and_configure'
...e/nvim/site/pack/packer/start/packer.nvim/lua/packer.lua:576: in function 'sync'
[string ":lua"]:1: in main chunk
The problem is that neovim actually sticks to lua 5.1
for different reasons.
The error most likely happens due to brew install luarocks
being built with lua
newer than 5.1
. Even if you have lua@5.1
installed with brew
, installing luarocks
with the mentioned command will install the newest version of lua
anyway.
I worked around it by compiling luarocks
manually with lua 5.1
headers from brew
. This worked for me:
$ brew install lua@5.1
$ curl -R -O https://luarocks.github.io/luarocks/releases/luarocks-3.9.2.tar.gz
$ tar -zxf luarocks-3.9.2.tar.gz
$ cd luarocks-3.9.2.tar.gz
$ ./configure --with-lua-include="/opt/homebrew/Cellar/lua@5.1/5.1.5_8/include/lua5.1"
$ make && make install
$ ln -s /usr/local/share/lua /opt/homebrew/share/
Unable to run
PackerSync
orPackerInstall
commands on mac.nvim --version
: v0.9.0git --version
: 2.39.2Steps to reproduce
Cloned repo to the right path
Used a simple
init.lua
using the https://github.com/nvim-lua/kickstart.nvim. Created a simplelua/
directory and create a file namedinstaller.lua
, paste packer configs.Content of
installer.lua
File structure of
~/.config/nvim
Actual behaviour