问题描述

VS Codecode runner 运行 lua 时,报错:'D:\Program' is not recognized as an internal or external command, operable program or batch file.


原因分析:

VS Code 的 code-runner 配置中,路径 D:\Program Files (x86)\lua-5.4.2_Win32_bin\lua54.exe 包含空格,导致命令行无法正确识别路径。

"code-runner.executorMap": {
    "lua": "D:\\Program Files (x86)\\lua-5.4.2_Win32_bin\\lua54.exe"
},

解决方案:

在配置文件中,确保路径被正确地用双引号括起来:

"code-runner.executorMap": {
    "lua": "\"D:\\Program Files (x86)\\lua-5.4.2_Win32_bin\\lua54.exe\""
},
Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐