I found following error when I'm rendering my nodejs project
{"level":"error","message":"uncaughtException SyntaxError: Use of const in strict mode.\n at Module._compile (module.js:439:25)\n at Object.Module._extensions..js (module.js:474:10)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)\n at Module.require (module.js:364:17)\n at require (module.js:380:17)\n at Object. (/var/www/myproject/dist/node_modules/sparkpost/node_modules/request/node_modules/hawk/lib/index.js:5:33)\n at Module._compile (module.js:456:26)\n at Object.Module._extensions..js (module.js:474:10)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)\n at Module.require (module.js:364:17)\n at require (module.js:380:17)\n at Object. (/var/www/myproject/dist/node_modules/sparkpost/node_modules/request/request.js:9:12)\n at Module._compile (module.js:456:26)\n at Object.Module._extensions..js (module.js:474:10)","timestamp":"2017-09-25T02:45:43.418Z"}
That's why I check sparkpost version inside my package.json file and found "sparkpost": "^1.3.7",
but when I checked with npm info sparkpost version
, it goes 2.1.2
Can something help me any suggestion that how can I check actual version of sparkpost and how can I fix that error message, thanks.
sparkpost
does not in fact support very old Node.js versions. Upgrading to at least Node 4.x might be your best solution. I opened a GitHub issue on this too. – Ewan DennisOld Node.js needs --harmony to enable const.
– PPShein