0
votes

I'm following the instructions to run ClojureScript Node.js REPL: https://github.com/clojure/clojurescript/wiki/Quick-Start

Everything works fine, but in the "Node.js REPL" section, I got the errors with rlwrap java -cp cljs.jar:src clojure.main node_repl.clj.

node.js> rlwrap java -cp cljs.jar:src clojure.main node_repl.clj
Exception in thread "main" java.io.FileNotFoundException: Could not locate cljs/build__init.class or cljs/build.clj on classpath., compiling:(/Users/smcho/Desktop/clojurescript/node.js/node_repl.clj:2:1)
    at clojure.lang.Compiler.load(Compiler.java:7249)
    ...
    at clojure.main.main(main.java:37)
Caused by: java.io.FileNotFoundException: Could not locate cljs/build__init.class or cljs/build.clj on classpath.
    at clojure.lang.RT.load(RT.java:449)
    ...
    at clojure.lang.Compiler.load(Compiler.java:7237)
    ... 9 more

I found that the cljs directory is in the out directory, but the cljs does not have build.clj nor build__init.class.

enter image description here

What might be wrong?

1

1 Answers

1
votes

I think the node_repl.clj has an error.

(require 'cljs.repl)
;;; (require 'cljs.build) ;; ERROR?
(require 'cljs.build.api) ;; <-- Replaced
(require 'cljs.repl.node) 

(cljs.build.api/build "src"
  {:main 'hello-world.core
   :output-to "out/main.js"
   :verbose true})

(cljs.repl/repl (cljs.repl.node/repl-env)
  :watch "src"
  :output-dir "out")

Now everything seems to work fine.