官网下载lua:
https://luabinaries.sourceforge.net/download.html
配置环境变量
在path目录配置lua安装目录

cmd运行lua

vs code配置lua
方式一:新建文件夹---> 新建lua脚本---> 点击终端---> 点击运行生成任务 ---> 选择MSBuild ---> 配置tasks.json (不支持中文)
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run Lua",
"type": "shell",
"command": "lua54",
"args": [
"${file}"
],
"group":{
"kind" : "build",
"isDefault": true
}
}
]
}
方式二:安装拓展工具 lua 、Lua Dubug
Lua Dubug配置:
点击创建launch.json
添加配置:
Lua Debug:Attach
Lua Debug:Attach Process
Lua Debug:Launch Process
Lua Debug:Launch Script
安装拓展工具:Code Runner
run code运行报错问题: 快捷键:ctrl+shift+p 打开setting.json 输入:code_runner:executorMap 将lua改为安装好的lua的文件名