diff -bur LuaJIT-2.1.0-beta3-orig/src/luaconf.h LuaJIT-2.1.0-beta3/src/luaconf.h
--- LuaJIT-2.1.0-beta3-orig/src/luaconf.h	2023-01-26 22:15:03.558193500 -0700
+++ LuaJIT-2.1.0-beta3/src/luaconf.h	2023-01-26 22:15:17.283052500 -0700
@@ -18,10 +18,17 @@
 ** In Windows, any exclamation mark ('!') in the path is replaced by the
 ** path of the directory of the executable file of the current process.
 */
-#define LUA_LDIR	"!\\lua\\"
-#define LUA_CDIR	"!\\"
+
+/* Paths for modules expecting non-jit lua5.1  */
+#define LUA_LDIR	"!\\..\\share\\lua\\5.1\\"
+#define LUA_CDIR	"!\\..\\lib\\lua\\5.1\\"
+
+#define LUAJIT_LDIR	"!\\..\\share\\luajit-2.1\\"
+
 #define LUA_PATH_DEFAULT \
-  ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
+  ".\\?.lua;" LUAJIT_LDIR"?.lua;" LUAJIT_LDIR"?\\init.lua;" \
+              LUA_LDIR"?.lua;"  LUA_LDIR"?\\init.lua;" \
+              LUA_CDIR"?.lua;"  LUA_CDIR"?\\init.lua"
 #define LUA_CPATH_DEFAULT \
   ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
 #else
