Clojure 已安装,但 clj 失败

Nas*_*ers 2 powershell clojure

我在 Windows 10 上通过 Powershell 安装了 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
Run Code Online (Sandbox Code Playgroud)

我将其安装到以下位置:C:\Program Files\WindowsPowerShell\Modules

我该如何解决这个错误?

小智 5

我认为你需要运行:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

因为您的系统不允许执行下载的脚本。当然,这对您来说有多安全完全取决于您。我建议查看我写的这个教程:

https://github.com/littleli/scoop-clojure/wiki/Getting-started

它提供了替代的、更方便的方式来安装 Clojure。此外,它还提供了简单的更新路径,并允许访问越来越多的您可能会发现有用的实用程序。

最后。如果您可以访问 Windows Subsystem for Linux (WSL2),我可能会朝这个方向发展。