esbenp / pdf-bot

🤖 A Node queue API for generating PDFs using headless Chrome. Comes with a CLI, S3 storage and webhooks for notifying subscribers about generated PDFs
MIT License
2.63k stars 142 forks source link

Not able to install pdf-bot #1

Closed maddy1512 closed 7 years ago

maddy1512 commented 7 years ago

I installed pdf-bot using npm but after installing whenever I run command pdf-bot install I get following error:

/usr/lib/node_modules/pdf-bot/bin/pdf-bot.js:328
function openConfig(delayQueueCreation = false) {
                                       ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

I don't know why it is throwing this error. Is it because of the node version?

esbenp commented 7 years ago

I think you need to have Node V6+ to support default parameters. What version do you have?

maddy1512 commented 7 years ago

Oh! I have v4.4.4

esbenp commented 7 years ago

Yeah apologies. I might refactor those parts to support below versions below 6. Lets leave the issue open for now for visibility's sake

maddy1512 commented 7 years ago

Ok and if possible you can also update README. Cheers!!

westy92 commented 7 years ago

@esbenp https://github.com/westy92/html-pdf-chrome requires Node.js V6+ as well. I'd like to note that Node.js V4 is out of active LTS support and only has maintenance updates until April 2018. Support for Node.js v5 has already been dropped. https://github.com/nodejs/LTS#lts-schedule1

esbenp commented 7 years ago

Yeah I actually tried to remove the defaults today but saw the tests failed from something in html-pdf-chrome. I guess I will just require Node v6+ :-)

Added d1542579c310e402cffa86d9849b226ad1764f39 and 6100fc06dc920ee177217e43026af6db5189b8c6