我开始使用 clojurescript 并已将 lein-cljsbuild 添加到我的 project.clj:
(defproject hello-world "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.4.0"]
[org.clojure/clojurescript "0.0-1450"]]
:plugins [[lein-cljsbuild "1.0.3"]]
:cljsbuild {:builds []})
当我在 PowerShell 和命令窗口中运行以下命令时:
lein trampoline cljsbuild repl-rhino
我不断收到以下错误:
(Retrieving cljsbuild/cljsbuild/0.2.7/cljsbuild-0.2.7.jar from clojars)
Exception in thread "main" org.mozilla.javascript.EcmaError: ReferenceError: "goog" is not defined. (bootjs#1),
compiling:(C:\Users\Karthik\AppData\Local\Temp\form-init8943880809592678534.clj:1:127)
我还需要做什么? ClojureScript: Up and Running 一书中概述了上述步骤,但对于 lein-cljsbuild "0.2.7"
最佳答案
以下版本对我有用:
(defproject hello-world "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2173"]]
:plugins [[lein-cljsbuild "1.0.2"]]
:cljsbuild {
:builds []})
更新到
lein-cljsbuild 1.0.3
和 clojurescript 0.0-2197
似乎破坏了犀牛复制。关于clojure - 引用错误 : "goog" is not defined when running lein cljsbuild,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24393603/