Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected token ... #45

Closed
aheadlcx opened this issue Oct 16, 2018 · 10 comments
Closed

SyntaxError: Unexpected token ... #45

aheadlcx opened this issue Oct 16, 2018 · 10 comments
Labels
Bug Something isn't working

Comments

@aheadlcx
Copy link

When I put percollate pdf --output as32.pdf https://github.com/danburzo/percollate , get this error.

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/percollate/cli.js:5:40)
@danburzo
Copy link
Owner

Thanks for reporting! Can you let me know your node.js version?

@aheadlcx
Copy link
Author

v8.0.0
@danburzo

@tanmayrajani
Copy link
Contributor

I think 8.0.0 may just need the --harmony flag.

Although, we might want to update the README

@aheadlcx
Copy link
Author

@tanmayrajani Adding this flag still not work.
The command is that 'percollate pdf --output --harmony as32.pdf https://github.com/danburzo/percollate' and return following log:

/usr/local/lib/node_modules/percollate/index.js:59
	return { ...parsed, url };
	         ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/percollate/cli.js:5:40)

@tanmayrajani
Copy link
Contributor

Right, I forgot to mention that I was having the project locally and was using it with node --harmony cli.js --output ... For it to work as a CLI app, we will have to change the following to have --harmony appended

#!/usr/bin/env node

@danburzo danburzo added the Bug Something isn't working label Oct 16, 2018
@aheadlcx
Copy link
Author

@tanmayrajani Thanks and looking forward to your next commit.

@danburzo
Copy link
Owner

I think the node --harmony thing is trickier, since it doesn't seem to be supported everywhere. We may just have to bump up the Node.js version requirement. I'm not sure how to find out the minimum Node version required by the code, but https://node.green/ suggest it's 8.6.0?

@aheadlcx
Copy link
Author

@danburzo Thanks for your answer.

@tanmayrajani
Copy link
Contributor

We may just have to bump up the Node.js version requirement. I'm not sure how to find out the minimum Node version required by the code, but https://node.green/ suggest it's 8.6.0?

That's probably a good idea. I see got follows the same:

https://github.com/sindresorhus/got/blob/8d2e91171509bc2aec71c4483978cfd421ebcf1d/package.json#L8-L10

@danburzo
Copy link
Owner

Made the change in the above commit. Will be publishing a new version on npm once we get in a few more fixes. Thanks both for the assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants