Fork me on GitHub

I love cofield’s dot-clojure repo: I would like to make an alias in my own global deps.edn file that will use the latest version of ClojureScript e.g.

  :extra-deps {org.clojure/clojurescript {:git/url ""
                                           :sha     "6431e6435ad9fc85e766752f4d6939ff978db5a5"}}
   :main-opts  ["--main" "cljs.main" "--repl-env" "node" "--repl"]}}}
But when I call the above, I get Error building classpath. Destination path "clojurescript" already exists and is not an empty directory. What am I missing here?


I did a little digging and was able to resolve my issue by executing the following steps: 1. Delete ~/.gitlibs/_repos/ (which was empty) 2. Run clj -A:cljs again Now everything seems to be working again. Is there a command in the tools.deps API that can do this automatically?

Alex Miller (Clojure team)16:11:34

I’ve seen a few people hit this but I have not been able to reproduce it and don’t have a ready fix for it


Fair. I tried to setup a minimal repro based on what my previous dir structure looked like, but can’t get it right. The best I found is this other interesting scenario 1. Successfully run clj -A:cljs as I have in the code snippet above (then stop the repl) 2. delete content of ~/.gitlibs/libs/org.clojure/clojurescript + ~/.gitlibs/_repos/ (both clojurescript still exist, but they are empty) Now when I run clj -A:cljs I get the following error

Execution error (FileNotFoundException) at clojure.main/main (
Could not locate cljs/main__init.class, cljs/main.clj or cljs/main.cljc on classpath.

Full report at:
The above is resolved by deleting .cpcache


The above seems odd, but that seem to be how my local looked at the time.


fwiw I had a similar problem recently (went away after deleting .gitlibs and/or .cpcache)

🙌 4

@tkjone Or perhaps putting -Sforce on that clj command, to force it to rebuild the cache?


i've been doing -Sforce more often than deleting .cpcache with some success recently -- iiuc this will leave older bits in .cpcache if you want to investigate issues later, helpful when reporting issues perhaps?


Yeah, you get a separate set of cached files for each alias combination you use, so it's nice to keep the ones that work fine and just override the ones that don't, via -Sforce.