我一直在尝试和一些朋友一起建立合作模拟器体验(鸸鹋鸡舍和bizhawk 合作社是两个不同的问题,但都表现出相同的症状)。在我的旧电脑上,下载和运行都很好。但是,我买了一台新电脑,从 Windows 7 升级到了 Windows 10(不确定这是否相关)。
现在,当我尝试运行使用 Lua 的脚本时,出现异常,提示找不到我的模块:
NLua.Exceptions.LuaScriptException: [string "main"]:35: module 'bizhawk-co-op\sync' not found:
no field package.preload['bizhawk-co-op\sync']
no file 'C:\Users\Kevin\Desktop\Randomizer Stuff\Snes 9x COOP\coop-full-1key14-1\coop'
no file 'C:\Users\Kevin\Desktop\Randomizer Stuff\Snes 9x COOP\coop-full-1key14-1\coop\modes'
no file 'C:\Users\Kevin\Desktop\Randomizer Stuff\Snes 9x COOP\coop-full-1key14-1\coop\pl'
no file 'C:\Users\Kevin\Desktop\Randomizer Stuff\Snes 9x COOP\coop-full-1key14-1\coop\socket'
no file '.\bizhawk-co-op\sync.dll'
no file 'C:\Users\Kevin\Desktop\BizHawk-2.3\bizhawk-co-op\sync.dll'
no file 'C:\Users\Kevin\Desktop\BizHawk-2.3\loadall.dll'
这些sync.lua
文件似乎存在,但它似乎专门在寻找 DLL 文件。我已经在互联网上搜索了很久,但似乎找不到任何类似的问题。
值得注意的是,我在刚刚构建的独立 Lua 安装中遇到了同样的问题:
C:\Users\Kevin\Desktop\Randomizer Stuff\Snes 9x COOP\coop-full-1key14-1>lua coop\coop.lua
lua: coop\coop.lua:1: module 'pl.class' not found:
no field package.preload['pl.class']
no file 'C:\Users\Kevin\Desktop\Randomizer Stuff\Snes 9x COOP\coop-full-1key14-1\coop'
no file 'C:\Users\Kevin\Desktop\Randomizer Stuff\Snes 9x COOP\coop-full-1key14-1\coop\modes'
no file 'C:\Users\Kevin\Desktop\Randomizer Stuff\Snes 9x COOP\coop-full-1key14-1\coop\pl'
no file 'C:\Users\Kevin\Desktop\Randomizer Stuff\Snes 9x COOP\coop-full-1key14-1\coop\socket'
no file 'C:\Users\Kevin\Desktop\lua-5.3.5.tar\lua\bin\pl\class.dll'
no file 'C:\Users\Kevin\Desktop\lua-5.3.5.tar\lua\bin\..\lib\lua\5.3\pl\class.dll'
no file 'C:\Users\Kevin\Desktop\lua-5.3.5.tar\lua\bin\loadall.dll'
no file '.\pl\class.dll'
no file 'C:\Users\Kevin\Desktop\lua-5.3.5.tar\lua\bin\pl.dll'
no file 'C:\Users\Kevin\Desktop\lua-5.3.5.tar\lua\bin\..\lib\lua\5.3\pl.dll'
no file 'C:\Users\Kevin\Desktop\lua-5.3.5.tar\lua\bin\loadall.dll'
no file '.\pl.dll'
stack traceback:
[C]: in function 'require'
coop\coop.lua:1: in main chunk
[C]: in ?
答案1
显然,这是表明您的 PATH 混乱的一种非常糟糕的方式。特别是,名为 LUA_PATH 的环境变量似乎覆盖了它试图执行的操作。哎呀。