找不到OpenShift,casperjs命令

时间:2015-02-12 21:09:58

标签: node.js bash phantomjs openshift casperjs

我在package.json中指定了这些依赖项。

"dependencies": {
    "express": "~3.4.4",
    "casperjs": "*",
    "phantomjs": "*"
},

当我将这些推送到OpenShift服务器时,我无法使用像casperjs test.js这样的命令。我得到bash: casperjs: command not found。但是,我确实在node_modules中看到了casperjs和phantomjs文件夹。

如果我在repo文件夹中手动执行npm install casperjs,该命令将起作用。我想当我将更改推送到OpenShift后,构建器将自动为我指定的依赖项执行npm安装。我在这里缺少什么?

更新:由于phantomjs也是一个依赖项,我尝试了这里建议的内容 https://blog.openshift.com/screen-scraper-as-a-service/ 我安装了二进制文件,命令phantomjs有效。但是当我重新启动OpenShift服务器时,该命令不再有效。我是否需要添加命令

cd app-root/data/ wget http://phantomjs.googlecode.com/files/phantomjs-1.8.0-linux-x86_64.tar.bz2 tar xf phantomjs-1.8.0-linux-x86_64.tar.bz2 rm phantomjs-1.8.0-linux-x86_64.tar.bz2 mv phantomjs-1.8.0-linux-x86_64/ phantomjs 到package.json中的scripts.start?我觉得我在这里错过了一些简单的东西。

1 个答案:

答案 0 :(得分:0)

我创建了一个新的应用程序,并通过npm安装了casperjs和phantomjs。现在,每个命令在重新启动服务器后都能正常工作。我认为我遇到的问题是一个我无法发现的错误或错误配置的错误。

相关问题