我尝试使用clojurescript编译器的新:npm-deps功能来包含React-Helmet组件(https://github.com/nfl/react-helmet)。 " dev"的相关片段建立:
: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"}}
我通过运行启动来获取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)。
答案 0 :(得分:1)
看起来node
二进制文件在执行编译的Java进程环境的PATH
上不可用。将其添加到PATH
应该可以解决问题。