clojurescriptfigwheelcljsbuild

:npm-deps fails "node" not found


I'm trying to use the new :npm-deps feature of the clojurescript compiler to include a React-Helmet component (https://github.com/nfl/react-helmet). Relevant snippet of the "dev" build:

: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"}}

I get the cljs REPL by running start! function in the in user ns:

(defn start! []
  (figwheel-sidecar.repl-api/start-figwheel!
    (figwheel-sidecar.config/fetch-config)
    "dev")
  (figwheel-sidecar.repl-api/cljs-repl "dev"))

And then the compilation fails with:

----  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

(Naturally node.js is installed).


Solution

  • It looks that node binary is not available on the PATH of Java process environment performing the compilation. Adding it to the PATH should solve the issue.