LuaJIT requires a module error

require "utils.lua" stdin:1: module 'utils.lua' not found: no field package.preload['utils.lua'] no file 'D:\blizzard\Projects\Lua' no file '.\utils\lua.dll' no file 'D:\blizzard\Projects\Lua\utils\lua.dll' no file 'D:\blizzard\Projects\Lua\loadall.dll' no file '.\utils.dll' no file 'D:\blizzard\Projects\Lua\utils.dll' no file 'D:\blizzard\Projects\Lua\loadall.dll' 

Why is LuaJIT looking for .dll instead of .lua and how to fix this behavior?

+6
source share
1 answer

You must require utils (cut .lua), and utils.lua must be in your package.path variable or passed as the LUA_PATH environment variable.

Further information in the Lua reference manual on package.loaders , require () and package.path

+11
source

Source: https://habr.com/ru/post/893148/


All Articles