luarocks cannot find any interpreter


  luarocks 3.9.2

  $ lua -v
  Lua 5.4.6

$ luarocks install --local --lua-version=5.1 xplr
sh: line 1: /usr/bin/lua5.1: No such file or directory

Error: No results matching query were found for Lua 5.1.
To check if it is available for other Lua versions, use --check-lua-versions.

attempted to install
extra/lua51 5.1.5-11
all versions got installed

5 extra/luajit 2.1.1696795921-1 (321.5 KiB 822.9 KiB) (Installed)
Just-in-time compiler and drop-in replacement for Lua 5.1
4 extra/lua51 5.1.5-11 (232.0 KiB 899.5 KiB) (Installed)
Powerful lightweight programming language designed for extending applications
3 extra/lua52 5.2.4-6 (253.0 KiB 1005.4 KiB) (Installed)
Powerful lightweight programming language designed for extending applications
2 extra/lua53 5.3.6-2 (282.9 KiB 1.1 MiB)
Powerful lightweight programming language designed for extending applications
1 extra/lua 5.4.6-2 (362.2 KiB 1.5 MiB) (Installed)
Powerful lightweight programming language designed for extending applications

$ luarocks install --local --lua-version=5.1 xplr
sh: line 1: /usr/bin/lua5.1: No such file or directory

Error: No results matching query were found for Lua 5.1.
To check if it is available for other Lua versions, use --check-lua-versions.

$ luarocks install --local  xplr

Error: No results matching query were found for Lua 5.4.
To check if it is available for other Lua versions, use --check-lua-versions.

When I try removing lua

$ yay -R lua

checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing lua breaks dependency 'lua' required by luarocks
:: removing lua breaks dependency 'lua' required by vlc
:: removing lua breaks dependency 'lua' required by wireplumber
 -> exit status 1

AFAICR luajit was already installed before I tried to install it.

Do you really need lua 5.1? I would clean up by removing lua 5.1 and 5.2 and then reinstall xplr again, but without the --lua-version part.

I found the issue. xplr is a lua application rather than a package.

Thanks

However luarocks does not work on my machine:

$ luarocks install  --local LuaFileSystem
Installing https://luarocks.org/luafilesystem-1.8.0-1.src.rock

luafilesystem 1.8.0-1 depends on lua >= 5.1 (5.4-1 provided by VM)
gcc -O2 -fPIC -I/usr/include -c src/lfs.c -o src/lfs.o
gcc  -shared -o lfs.so src/lfs.o
luafilesystem 1.8.0-1 is now installed in /home/1000/.luarocks (license: MIT/X11)

lfs.c is nowhere to be found on my system, hence compilation does not occur.

I tried the same with

sudo luarocks install  lua-cjson

These are the two most popular lua packages.