2

我正在尝试使用 clojurescript 编译器的新 :npm-deps 功能来包含 React-Helmet 组件(https://github.com/nfl/react-helmet)。“开发”构建的相关片段:

: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)。

4

1 回答 1

1

看起来二进制文件在执行编译的 Java 进程环境node中不可用。PATH将其添加到PATH应该可以解决问题。

于 2017-11-09T08:13:18.073 回答