【发布时间】:2018-04-21 20:00:23
【问题描述】:
我正在尝试使用 clojurescript 编译器的新 :npm-deps 功能来包含 React-Helmet 组件 (https://github.com/nfl/react-helmet)。 “dev”构建的相关sn-p:
:compiler {:main "app.ui.core"
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
:source-map-timestamp true
:preloads [print.foo.preloads.devtools]
:closure-defines {goog.DEBUG true}
:external-config {:devtools/config {:features-to-install :all}}
:npm-deps {:react-helmet "5.2.0"}}
我通过运行 start 获得了 cljs REPL!在用户 ns 中的函数:
(defn start! []
(figwheel-sidecar.repl-api/start-figwheel!
(figwheel-sidecar.config/fetch-config)
"dev")
(figwheel-sidecar.repl-api/cljs-repl "dev"))
然后编译失败:
---- Exception ----
java.io.IOException : Cannot run program "node": error=2, No such file or directory
java.io.IOException : error=2, No such file or directory
---- Exception Stack Trace ----
clojure.core/eval core.clj: 3105
user/start! user.clj: 12
figwheel-sidecar.repl-api/start-figwheel! repl_api.clj: 26
figwheel-sidecar.repl-api/start-figwheel! repl_api.clj: 29
(自然是安装了node.js)。
【问题讨论】:
-
您可能已经安装了 node.js,但在
PATH上对于运行编译的 Java 进程不可用。你能检查一下是不是这样吗? -
确实没有 - /usr/bin 中的符号链接修复了它。此外,在终端会话中运行的 figwheel 可能可以访问 ~/.nvm/versions/node/v8.4.0/bin 能够正常编译。如果你能写下你的评论作为答案,我会接受。
标签: clojurescript figwheel cljsbuild