【问题标题】::npm-deps fails "node" not found:npm-deps 失败“节点”未找到
【发布时间】: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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-23
    • 2020-11-05
    • 2014-01-05
    • 2017-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-04
    相关资源
    最近更新 更多