apex / capture

Lambda function to capture a URL as PNG, JPG, or GIF using PhantomJS
108 stars 5 forks source link

Error: spawnSync ./phantomjs ENOENT #6

Open build1984 opened 6 years ago

build1984 commented 6 years ago

Hi tj,

Sorry for dig this out, I got Error: spawnSync ./phantomjs ENOENT error when I try to run capture locally via node script.js, (script.js is basically the index.js of capture, and I did put phantomjs and convert.js in the same directory). Could you please give me a hint where the problem might be? Thank you.

const proc = require('child_process')

const args = ['convert.js', JSON.stringify({
  'url': 'https://google.com',
  'backgroundColor': 'white',
  'format': 'jpeg'
})]
const capture = proc.execFileSync('./phantomjs', args).toString()
console.log(capture)