I am new to Node.js and just started building an application using Eclipse and Nodeclipse plug-ins. When I run the app using Node core.js it works fine, but using Eclipse it shows me the following error:
/home/sarojs/projects/Core/security.js:3
class Security {
^^^^^
SyntaxError: Unexpected reserved word
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/home/sarojs/projects/node/liveprojects/ecurvInc/Core/core.js:12:16)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
I can't figure out what is wrong here. I googled for the solution and found some resources Unexpected reserved word, but I didn't understand how to incorporate it into Eclipse.
My package.json looks like this:
{
"dependencies": {
"bluebird": "^3.4.0",
"body-parser": "~1.8.1",
"cookie-parser": "~1.3.3",
"cors": "^2.8.1",
"debug": "~2.0.0",
"express": "~4.9.0",
"express-handlebars": "^3.0.0",
"express-session": "^1.13.0",
"mysql": "^2.11.1",
"passport": "^0.3.2",
"passport-local": "^1.0.0"
}
}
- Node.js version: 4.4.6
- IDE: Eclipse Mars 1 with Nodeclipse plug-ins
Any help would be highly appreciated.