在 Windows 上设置带有 JSON 模块的 LUA

我需要帮助将 .lua 文件转换为 JSON。一个使用 Linux 的人给了我一个非常简单的 LUA 脚本来将 .lua 转换为 JSON:

require('json');
dofile "<你的文件>";

local encoded = json.encode(CensusPlus_Database);
print(encoded);

免责声明,我对这种东西了解很少,并且需要从头开始。第一步是安装 LUA。我从这个网站上安装的,https://sourceforge.net/projects/luabinaries/files/5.2.4/Tools%20Executables/

然后我尝试运行上述 LUA 脚本,收到了“未找到'json'模块”的消息。

请问有人可以告诉我如何安装 JSON 模块吗?

原文链接 https://stackoverflow.com/questions/70169939

点赞