如何在弹性beanstalk上安装phantomjs?

时间:2018-01-09 19:20:45

标签: node.js phantomjs elastic-beanstalk

过去几个小时,我一直在google上阅读不同的SO和github问题。我已经尝试将一个phantomjs配置文件添加到.ebextensions文件夹中,我尝试包含一个安装幻像js的buildspec文件,还有一些其他东西,我似乎无法在运行nodejs的弹性beanstalk实例上安装phantomjs。这是package.json和错误。任何关于如何使这项工作的想法都会非常有用。谢谢!

这是package.json

{
  "name": "webcrawler",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "mocha **/*.test.js",
    "test-watch": "nodemon --exec 'npm test'",
    "start": "node app.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@types/cheerio": "^0.22.6",
    "@types/phantom": "^3.2.3",
    "cheerio": "^1.0.0-rc.2",
    "express": "^4.16.2",
    "line-by-line": "^0.1.6",
    "node-schedule": "^1.2.5",
    "phantom": "^4.0.12",
    "phantomjs-prebuilt": "^2.1.16",
    "request": "^2.83.0",
    "write": "^1.0.3"
  },
  "devDependencies": {
    "@types/chai": "^4.0.10",
    "@types/express": "^4.11.0",
    "chai": "^4.1.2",
    "mocha": "^4.0.1",
    "sinon": "^4.1.3"
  }
}

错误

  
    

phantomjs-prebuilt@2.1.16 install / tmp / deployment / application / node_modules / phantomjs-prebuilt     node install.js          在PATH上找不到PhantomJS下载已在/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2已经过验证     以前下载的文件的校验和提取tar内容(通过     产生过程)删除     的/ tmp /部署/应用/ node_modules / phantomjs-预置的/ lib目录/幻     复制提取的文件夹     /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1515525280131/phantomjs-2.1.1-linux-x86_64      - >的/ tmp /部署/应用/ node_modules / phantomjs-预置的/ lib目录/幻     运行npm install:     /opt/elasticbeanstalk/node-install/node-v7.10.1-linux-x64/bin/npm
    将npm配置作业设置为1 npm配置作业设置为1运行npm     with --production flag无法运行npm install。快照日志     更多细节。 UTC 2018/01/09 19:17:20找不到应用程序npm     调试日志在/tmp/deployment/application/npm-debug.log          Traceback(最近一次调用最后一次):         文件" /opt/elasticbeanstalk/containerfiles/ebnode.py" ;,第695行,.... [/ p>   

1 个答案:

答案 0 :(得分:0)

不是最理想的解决方案,但我将弹性beanstalk实例降级为早期版本,然后开始工作。

enter image description here