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 import #1

Closed
SergeGardien opened this issue Dec 24, 2016 · 2 comments
Closed

SyntaxError: Unexpected token import #1

SergeGardien opened this issue Dec 24, 2016 · 2 comments

Comments

@SergeGardien
Copy link

I've tried to execute the JS with Node.js (both under Eclipse and via OSX Terminal) but I got the error:
SyntaxError: Unexpected token import

@dleshem , do you have the same issue?

@dleshem
Copy link
Owner

dleshem commented Dec 24, 2016

import is ES6 syntax that's not supported natively by node. You can use a transpiler like https://babeljs.io/ to convert the code to ES5.

Since this code is educational in nature, I have no intention to make it ES5 compliant.

@SergeGardien
Copy link
Author

Yes, I was already trying to use Babel (I've read a few posts around the web) but it seems I cannot make it work.
I'll try to figure it out.

Tx for the reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants