私はノードnewを使ってアプリケーションを起動しました。ノードcore.jsを使用してアプリケーションを実行しました。エラー。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)
ここで何が間違っているかわかりません。私は私のpackage.jsonがFYI
{
"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"
}
}
のように見える解決のためにGoogleで検索し、いくつかのリソース
Unexpected reserved wordが見つかりましたが、私のEclipseに
を組み込む方法を理解していなかった。
私のノードのバージョンが4.4.6
IDE eclipse Nodeclipseプラグインを搭載したMars 1
ご協力いただければ幸いです。
あなたがES6を理解している環境で書いていないのであれば、ES5でないものについて警告するでしょう。 –