Lua cannot load Love modules
Posted: Sun Oct 04, 2020 11:23 pm
I'm trying to learn Love, and I am attempting to use the interactive REPL that is outlined here: https://gitlab.com/alexjgriffith/min-lo ... ree/master
When I try to run `love .` in an inferior REPL in emacs, nothing happens. As best I can tell, this is because Lua cannot import the `love.event` module:
I am not very experienced with Lua, so I don't know if I need to set some env var that will point to the right libraries or what. I am running into this on Ubuntu 18.04; I've tried with both Lua 5.3 and Lua 5.1.
If I run `love .` from the root of my game directory, the game runs as expected. I would like to interactively develop, however, so I would... love... to make Lua/Fennel able to load love as a module. Any help would be much appreciated.
When I try to run `love .` in an inferior REPL in emacs, nothing happens. As best I can tell, this is because Lua cannot import the `love.event` module:
Code: Select all
❯ lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> require("love.event")
stdin:1: module 'love.event' not found:
no field package.preload['love.event']
no file '/usr/local/share/lua/5.3/love/event.lua'
no file '/usr/local/share/lua/5.3/love/event/init.lua'
no file '/usr/local/lib/lua/5.3/love/event.lua'
no file '/usr/local/lib/lua/5.3/love/event/init.lua'
no file '/usr/share/lua/5.3/love/event.lua'
no file '/usr/share/lua/5.3/love/event/init.lua'
no file './love/event.lua'
no file './love/event/init.lua'
etc...
stack traceback:
[C]: in function 'require'
stdin:1: in main chunk
[C]: ?
If I run `love .` from the root of my game directory, the game runs as expected. I would like to interactively develop, however, so I would... love... to make Lua/Fennel able to load love as a module. Any help would be much appreciated.