【发布时间】:2017-07-04 07:35:46
【问题描述】:
我安装了phantomjs 和casperjs,使用lein new mies casper-ghost 创建了一个新项目,并将[ghost "0.1.0-alpha1] 依赖项添加到project.clj。
然后我将示例代码从https://github.com/casperjs/ghost 复制到core.cljs 文件并成功编译它,使用./scripts/build。
当我尝试使用 casperjs out/casper_ghost.js 运行它时,它给了我错误:
ClojureScript could not load :main, did you forget to specify :asset-path?
ReferenceError: Can't find variable: goog
file:///usr/lib/node_modules/casperjs/bin/bootstrap.js:1 in global code
我尝试按如下方式创建自定义构建脚本:
(require 'cljs.build.api)
(cljs.build.api/build "src"
{:main 'hello-world.core
:output-to "out/main.js"})
并使用lein -m clojure.main build.clj 成功运行,但使用 casperjs 运行out/main.js 会导致同样的错误。
有人可以指出如何从 linux 终端运行 ghost 脚本的正确方向吗?
【问题讨论】:
标签: terminal casperjs clojurescript