我通过 Powershell 在 Windows 10 上安装了 Clojure,安装时没有任何错误。然而,当我输入“clj”时,它给出了以下错误:
clj : The 'clj' command was found in the module 'ClojureTools', but the module could not be loaded. For more
information, run 'Import-Module ClojureTools'.
At line:1 char:1
+ clj
+ ~~~
+ CategoryInfo : ObjectNotFound: (clj:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
我将其安装到以下位置:C:\Program Files\WindowsPowerShell\Modules
如何解决此错误?
最佳答案
我认为你需要运行:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
因为您的系统不允许执行下载的脚本。当然,这对您来说有多安全完全取决于您。 我建议您查看我编写的本教程:
https://github.com/littleli/scoop-clojure/wiki/Getting-started
它提供了替代的、更方便的方式来安装 Clojure。此外,它还提供了简单的更新路径,并允许访问越来越多的对您可能有用的实用程序。
最后。如果您可以访问适用于 Linux 的 Windows 子系统 (WSL2),我可能会朝这个方向发展。关于powershell - Clojure 已安装,但 clj 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70613828/