-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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 reserved word when exporting a class in Node v4.0.0 #2954
Comments
Yes, you would need to use |
Going to go ahead and close as this isn't directly actionable. |
=[ whyyy ?? |
where would one use module.exports? I've done a project search and that line comes up around 200 times... |
The object module.exports is what will be returned when someone requires your project. A short hand for the object is simply exports The object is created by mode for every file, but you can overwrite it. Many people do exports.someFunction to export individual functions. Whatever object module.exports is referring to is what will be returned |
I have started using Node 4 and implemented a simple class:
But I get an error message:
I have followed recommendations made in a StackOverflow question: http://stackoverflow.com/questions/32657516/how-to-export-a-es6-class-properly-in-node-4
It looks like a bug to me, or what am I doing wrong? My node version is: v4.0.0.
The text was updated successfully, but these errors were encountered: