gpt4 book ai didi

macos - 如果出现错误 : "Could not locate clojure/data/files" appears?,如何在 macOS Monterey 12.5 上安装 Dirac(ClojureScript 的 Chrome DevTools 分支)

转载 作者:行者123 更新时间:2023-12-05 05:36:39 25 4
gpt4 key购买 nike

我正在尝试安装 Dirac在运行 Monterey 12.5 的 Macbook Air M1 上。

我正在关注 documentation这表明:

curl -s https://raw.githubusercontent.com/binaryage/dirac/master/install > /tmp/dirac.install && sudo bash /tmp/dirac.install

安装似乎已经成功,因为它存在于二进制文件中:

   Pedros-MacBook-Air:bin pedro$ pwd
/usr/local/bin

Pedros-MacBook-Air:bin pedro$ ls -1
dirac
lein

不幸的是,当我转到运行 dirac 的手册的第二步时,检索到以下错误:

   Pedros-MacBook-Air:bin pedro$ dirac
WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/update-vals
WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/update-keys
WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/update-vals
WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/update-keys
WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.passes, being replaced by: #'clojure.tools.analyzer.utils/update-vals
WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.passes.uniquify, being replaced by: #'clojure.tools.analyzer.utils/update-vals
Execution error (FileNotFoundException) at dirac.nrepl.compilation.direct/eval15283$loading (direct.clj:1).
Could not locate clojure/data/json__init.class, clojure/data/json.clj or clojure/data/json.cljc on classpath.

Full report at:
/var/folders/fh/7d_1drwd2ps3zw03j9ftkqs80000gn/T/clojure-1010884132545121253.edn

最初,我尝试在 home 文件夹中运行它。我认为它会很好。

然后,我决定在包含文件 clojure/data/json.clj 的项目文件夹中运行它包含在project.clj 文件中。不幸的是,即使这种方法也没有奏效。

下面是 project.clj 文件的简化版本:

(defproject abcd    ; Should be copied from shadow-cljs.edn
:description "xxxx"
:url "xxxx"

:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.339"]
[org.clojure/tools.nrepl "RELEASE"]
[binaryage/devtools ~devtools-version]
[binaryage/dirac ~dirac-version]
[org.clojure/data.json "2.4.0"]
[figwheel ~figwheel-version]
;; Selmer for templating of .json config files
[selmer "1.12.50"]]

... (omitted content because it seems irrelevant) ...

:profiles {:repl
{:repl-options {:port 8230
:nrepl-middleware [dirac.nrepl/middleware]
:init (do
(require 'dirac.agent)
(dirac.agent/boot!))


}}})

1 - 我认为 Dirac 即使在项目文件夹之外也能解决问题。是否必须在项目文件夹中?

2 - 为什么 Dirac 提示 Json 库,即使它被列为依赖项?clojure/data/json.clj(检索到的错误消息)和 org.clojure/data.json(我的依赖项)之间有什么区别吗?

最佳答案

您已在 dirac/issues/98 上收到解决方法: 添加 {:deps {org.clojure/data.json {:mvn/version "2.4.0"}}} 到 ~/.clojure/deps.edn。

本地启动器脚本依赖于 ClojureScript 的发布版本,不再包含 clojure/data.json。更好的解决方法是更改​​/usr/local/bin/dirac 文件 line 119通过在其中添加 clojure.data.json(或固定到 1.11.51 之前的 ClojureScript 版本):

DEPS="{:deps {\
$DIRAC_CLI_DEPS_COORDINATE \
org.clojure/clojurescript {:mvn/version \"RELEASE\"} \
org.clojure/data.json {:mvn/version \"2.4.0\"} \
clj-logging-config/clj-logging-config {:mvn/version \"1.9.12\"} \
}}"

解释

依赖项 org.clojure/data.json 已从 2022 年 5 月 13 日的 1.11.51 版本的 ClojureScript 中删除。参见 release notes :

Vendorization of tools.reader, data.json, and transit-clj
(...)
After conferring with the Clojure Team, we decided to vendorize all these dependencies. This way we can AOT everything and be confident that we won’t create a conflict that can’t easily be fixed via normal dependency management. (...) The dependance on data.json has been removed.

关于macos - 如果出现错误 : "Could not locate clojure/data/files" appears?,如何在 macOS Monterey 12.5 上安装 Dirac(ClojureScript 的 Chrome DevTools 分支),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73264414/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com