如何通过Lua Rocks安装lua模块/库?

我已经安装了JSON库,并使用require使用它,现在我想安装一个日期/时间库,但它说我必须通过_Lua Rocks_安装它。我搜索了一下,但最后没有结果

日期/时间库链接:https://github.com/daurnimator/luatz

我下载了luarocks.zip并点击了install.bat,在我的终端中打开它,现在我得到了一个新的挑战:

========================
== 检查系统... ==
========================

管理员权限可用于安装

寻找Lua解释器

    检查 C:\Users\Administrator\Downloads\Compressed\Cmder\vendor\conemu-maximus5\ConEmu\Scripts

    检查 C:\Users\Administrator\Downloads\Compressed\Cmder\vendor\conemu-maximus5

    检查 C:\Users\Administrator\Downloads\Compressed\Cmder\vendor\conemu-maximus5\ConEmu

    检查 C:\Program Files\Common Files\Oracle\Java\javapath

    检查 C:\ProgramData\Oracle\Java\javapath

    检查 C:\Windows\system32

    检查 C:\Windows

    检查 C:\Windows\System32\Wbem

    检查 C:\Windows\System32\WindowsPowerShell\v1.0

    检查 C:\Program Files\GtkSharp\2.12

    检查 C:\Users\Administrator\Downloads\Compressed\Lua53

       找到lua53.exe,正在测试它...

       错误:解释器不起作用

    检查 c:\lua5.1.2

    检查 c:\lua

    检查 c:\kepler\1.1

找不到Lua。请参见/?以获取指定Lua位置的选项,或安装捆绑的Lua 5.1拷贝。

安装LuaRocks失败。运行/?以获取帮助。
点赞
用户12514997
用户12514997

首先安装包管理器Luarocks。

使用以下说明:

[Windows](https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows)

[MacOS](https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-macOS)

[Linux或其他Unix](https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Unix)

接下来,打开您的终端/命令提示符。

键入luarocks install luatz

您应该能够立即使用local luatz = require“luatz” 要求luatz

2019-12-23 06:56:19