I’m a node noob so apologies if this is a silly question… I want to use classes, and I read that they’re only supported in strict mode. I tried doing this:
"use strict";
class a {
}
But it gives this error:
class a {
^^^^^
SyntaxError: Unexpected reserved word
Ok, I think this might be due to the node version. process.version returns v0.12.2 (which seems quite old, pre io.js according to this page). However in my packages.json I have this (which was in the template project):
There’s already an engines section in packages.json which is probably fine for selecting.
A newer version would really help though… I’m sort-of abandoning my TypeScript testing ;( Simple cases worked but it doesn’t seem to be compiling the modules/scripts properly when I tried adding more (I think a ts-node issue). ES classes would be much more tolerable than old-skool JS
It would be great to at least keep up with the recommended LTS version at nodejs.org, currently 4.4.5. Looks like HyperDev is now 4.4.3 so maybe that’s close enough. Of course even better would be to actually use the version specified in packages.json!