我是新來的節點剛剛啓動了一個應用程序使用eclipse和nodeclipse插件。當我運行應用程序使用節點core.js它工作正常,但使用Eclipse它顯示我以下錯誤。Nodejs應用程序SyntaxError:意外的保留字'class'
/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)
無法弄清楚這裏有什麼問題。我用Google搜索解決方案,並發現了一些資源Unexpected reserved word,但不知道如何將其納入我的日食
我的package.json貌似
{
"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"
}
}
FYI:
我的節點版本是4.4.6
IDE eclipse Mars 1 with nodeclipse插件
任何幫助將不勝感激。
如果你不是在瞭解ES6的環境中編寫的,它會警告你關於不是ES5的東西。 –