【问题标题】:Kscript: script compilation failed. What's the issue?Kscript:脚本编译失败。有什么问题?
【发布时间】:2020-10-28 16:16:05
【问题描述】:

由于参数无效导致编译失败,我无法执行简单的 Kotlin 脚本。

这是我的 Kotlin 脚本:

#!/usr/bin/env kscript 
println("Helloooo")

然后我编写了非常简单的脚本,我添加了可执行权限来执行它: chmod u+x SomeScript.kts

这是错误:

$ ./SomeScript.kts
[kscript] [ERROR] compilation of './SomeScript.kts' failed
error: invalid argument: -d
info: use -help for more information

我该如何解决?

【问题讨论】:

  • 解决了!我已经通过 Homebrew 正确安装了 kscript,但由于某种原因,只有 kotlinc 不在 PATH 中。我添加了它,现在它可以工作了!

标签: kotlin scripting kotlin-script


【解决方案1】:

你安装了正确的 kscript 吗? 在您的系统操作系统中检查此处https://github.com/holgerbrandl/kscript

【讨论】:

    猜你喜欢
    • 2018-10-23
    • 2013-05-14
    • 2022-01-21
    • 2014-01-13
    • 2018-08-22
    • 2017-12-02
    • 1970-01-01
    • 2016-08-12
    相关资源
    最近更新 更多