hi! I'm somehow getting a nullpointerexception when trying to set this up. I have the following in ~/.clojure/deps.edn :
:aliases {:rebel {:extra-deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"}}
:main-opts ["-m" "rebel-readline.main"]}
:new {:extra-deps {com.github.seancorfield/clj-new
{:mvn/version "1.1.297"}}
:exec-fn clj-new/create
:exec-args {:template "app"}}}and running clojure -X:new :name myname/myapp gives me this stacktrace:
{:clojure.main/message
"Execution error (NullPointerException) at clj-exec/requiring-resolve' (clj_exec.clj:57).\nnull\n",
:clojure.main/triage
{:clojure.error/class java.lang.NullPointerException,
:clojure.error/line 57,
:clojure.error/symbol clj-exec/requiring-resolve',
:clojure.error/source "clj_exec.clj",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type java.lang.NullPointerException,
:at [clojure.core$namespace invokeStatic "core.clj" 1603]}],
:trace
[[clojure.core$namespace invokeStatic "core.clj" 1603]
[clojure.core$namespace invoke "core.clj" 1597]
[clj_exec$requiring_resolve_SINGLEQUOTE_
invokeStatic
"clj_exec.clj"
57]
[clj_exec$requiring_resolve_SINGLEQUOTE_ invoke "clj_exec.clj" 54]
[clj_exec$exec invokeStatic "clj_exec.clj" 67]
[clj_exec$exec doInvoke "clj_exec.clj" 64]
[clojure.lang.RestFn invoke "RestFn.java" 423]
[clj_exec$exec_alias invokeStatic "clj_exec.clj" 89]
[clj_exec$exec_alias invoke "clj_exec.clj" 80]
[clj_exec$_main invokeStatic "clj_exec.clj" 100]
[clj_exec$_main doInvoke "clj_exec.clj" 95]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 665]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]]}}
Any idea what's happening?@arne-clojurians Are you running that command in a directory that has a deps.edn file? Maybe that has a :new alias that is hiding your user-level one?
Also, what does clojure -Sdescribe say?
@seancorfield thanks for your response! the error happens in different directories, none of which has a deps.edn, so the shadowing doesn't happen.
clojure -Sdescribe looks like this:
{:version "1.10.1.645"
:config-files ["/nix/store/1j1rbh1yy66rmpf1lqfsafni06k7bvid-clojure-1.10.1.645/deps.edn" "/home/arne/.clojure/deps.edn" ]
:config-user "/home/arne/.clojure/deps.edn"
:config-project "deps.edn"
:install-dir "/nix/store/1j1rbh1yy66rmpf1lqfsafni06k7bvid-clojure-1.10.1.645"
:config-dir "/home/arne/.clojure"
:cache-dir "/home/arne/.clojure/.cpcache"
:force false
:repro false
:resolve-aliases ""
:classpath-aliases ""
:jvm-aliases ""
:main-aliases ""
:tool-aliases ""
:all-aliases ""}and (last (:config-files %)) / (:config-user %) is the correct config file
the other deps.edn in /nix/store/… is the vanilla deps.edn:
{
:paths ["src"]
:deps {
org.clojure/clojure {:mvn/version "1.10.1"}
}
:aliases {
:deps {:extra-deps {org.clojure/tools.deps.alpha {:mvn/version "0.9.763"}}}
:test {:extra-paths ["test"]}
}
:mvn/repos {
"central" {:url " "}
"clojars" {:url " "}
}
}1.10.1.645 is pretty old — a lot has changed since then — and that isn’t even a stable release: https://clojure.org/releases/tools
clj-new’s README states 1.10.1.727 as a minimum version.
LMK if you still see the error on an up-to-date Clojure CLI.
Indeed! I updated to 1.10.3.x and it works flawlessly. Thanks 🙂