如何在 clojure 中获得有意义的依赖错误?
how to get meaningful dependency errors in clojure?
如果我添加以下要求:
(ns project.core
(:require
[compojure.route :as route])
(:gen-class))
(defn -main [& {:as args}]
(println "hello"))
做
lein run
我明白了
Syntax error macroexpanding clojure.core/ns at (ring/util/mime_type.clj:1:1).
((require [clojure.string :as str])) - failed: Extra input spec: :clojure.core.specs.alpha/ns-form
有什么办法可以得到
“compojure.route 未找到;未定义;或其他”,例如有意义的东西?
如果我删除它,它工作正常。例如它说你好
在 Java 14.0.1 OpenJDK 64 位服务器虚拟机上使用 Leiningen 2.9.4
您正在使用的项目使用了非常旧的依赖项。 Clojure 规范(引入了“recenlty”)添加了 macro/compile 时间检查并且上面提到的文件会触发它。
compojure.route
实际上是被发现的,然后它需要它的传递依赖。并且在链下 ring.util.mime-type
是必需的,并且您正在使用的版本还没有为当前的 Clojure 版本准备好。
你最好的选择是升级你的部门。例如。如果您正在关注一本书或者如果您正在使用模板,则可能会发生这种情况。如果您安装了 lein-ancient
,它可以为您尝试更新。否则你最好的选择是从你的 project.clj
开始并比较版本(例如检查 clojars)。
如果问题仍然存在,请查看 lein deps :tree
并了解可传递部门发生了什么。
如果我添加以下要求:
(ns project.core
(:require
[compojure.route :as route])
(:gen-class))
(defn -main [& {:as args}]
(println "hello"))
做
lein run
我明白了
Syntax error macroexpanding clojure.core/ns at (ring/util/mime_type.clj:1:1).
((require [clojure.string :as str])) - failed: Extra input spec: :clojure.core.specs.alpha/ns-form
有什么办法可以得到 “compojure.route 未找到;未定义;或其他”,例如有意义的东西? 如果我删除它,它工作正常。例如它说你好
在 Java 14.0.1 OpenJDK 64 位服务器虚拟机上使用 Leiningen 2.9.4
您正在使用的项目使用了非常旧的依赖项。 Clojure 规范(引入了“recenlty”)添加了 macro/compile 时间检查并且上面提到的文件会触发它。
compojure.route
实际上是被发现的,然后它需要它的传递依赖。并且在链下 ring.util.mime-type
是必需的,并且您正在使用的版本还没有为当前的 Clojure 版本准备好。
你最好的选择是升级你的部门。例如。如果您正在关注一本书或者如果您正在使用模板,则可能会发生这种情况。如果您安装了 lein-ancient
,它可以为您尝试更新。否则你最好的选择是从你的 project.clj
开始并比较版本(例如检查 clojars)。
如果问题仍然存在,请查看 lein deps :tree
并了解可传递部门发生了什么。