2

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

fbielejec
  • 3,492
  • 4
  • 27
  • 35
  • You might have node.js installed but not available on `PATH` for your Java process running the compilation. Could you please check if that's the case? – Piotrek Bzdyl Nov 09 '17 at 07:23
  • Indeed not - symlink in /usr/bin fixed it. Also figwheel running in a terminal session, which presumably had access to ~/.nvm/versions/node/v8.4.0/bin was able to compile just fine. If you could write your comment as an answer I'll accept it. – fbielejec Nov 09 '17 at 08:07

1 Answers1

1

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.

Piotrek Bzdyl
  • 12,965
  • 1
  • 31
  • 49