0
votes

I have been google and reading different SO and github issues about this for the last few hours. I have tried adding a phantomjs config file to an .ebextensions folder, I have tried including a buildspec file that installs phantom js, and a bunch of other things and I cant seem to get phantomjs installed on my elastic beanstalk instance running nodejs. This is the package.json and the error. Any ideas as how to get this working would be really helpful. Thanks!

This is the 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"
  }
}

error

[email protected] install /tmp/deployment/application/node_modules/phantomjs-prebuilt node install.js PhantomJS not found on PATH Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 Verified checksum of previously downloaded file Extracting tar contents (via spawned process) Removing /tmp/deployment/application/node_modules/phantomjs-prebuilt/lib/phantom Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1515525280131/phantomjs-2.1.1-linux-x86_64 -> /tmp/deployment/application/node_modules/phantomjs-prebuilt/lib/phantom Running npm install: /opt/elasticbeanstalk/node-install/node-v7.10.1-linux-x64/bin/npm
Setting npm config jobs to 1 npm config jobs set to 1 Running npm with --production flag Failed to run npm install. Snapshot logs for more details. UTC 2018/01/09 19:17:20 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log Traceback (most recent call last): File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in ....

1
Did you try the technique described in this blog post? medium.com/@sebastien.carceles/…Sébastien Saunier

1 Answers

0
votes

Not the most ideal solution, but I downgraded the elastic beanstalk instance to an earlier version an then it started to work.

enter image description here