Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unable to run ClojureScript Hello World program, "Error building classpath. Error reading edn."

I am trying to run a simple ClojureScript hello world program using instructions from the ClojureScript QuickStart page, but when I run the command clj -M --main cljs.main --compile hello-world.core --repl (in the hello-world project folder), I am getting this error : Error building classpath. Error reading edn. Invalid number: 1.10.758 (/some_path_to_/deps.edn).

The ClojureScript code is:

(ns hello-world.core)

(println "Hello world!")

and the deps.edn file contains:
{:deps {org.clojure/clojurescript {:mvn/version 1.10.758}}}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

How do I get rid of this error?

>Solution :

You need double-quotes around the version number. Sample file:

{:deps    {
           org.clojure/clojure             {:mvn/version "1.10.2-alpha1"}
           org.clojure/clojurescript       {:mvn/version "1.10.764"}

           com.bhauman/figwheel-main       {:mvn/version "0.2.11"}
           com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}

           re-frame                        {:mvn/version "1.0.0"}
           reagent                         {:mvn/version "0.10.0"}
           reagent-utils                   {:mvn/version "0.3.3"}

           org.clojure/spec.alpha          {:mvn/version "0.2.176"}
           prismatic/schema                {:mvn/version "1.1.12"}
           tupelo                          {:mvn/version "20.07.21"}
           }

 :paths   ["src" "test" "target" "resources"]

 :aliases {
           :ancient {:main-opts  ["-m" "deps-ancient.deps-ancient"]
                     :extra-deps {deps-ancient {:mvn/version "RELEASE"}}}
           :fig     {:main-opts ["-m" "figwheel.main"]}
           :dev     {:main-opts ["-m" "figwheel.main" "--build" "dev" "--repl"]
                     ; :extra-deps {tupelo {:local/root "/Users/r634165/tupelo/target/uberjar/tupelo-0.9.XXXXX-standalone.jar"}}
                     }
           }
 }

I have not used CLJS recently, but the above shows the proper form.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading