我在使用hapi.js,一切都很好。突然,我得到了以下错误,我认为这是由于node.js版本:
/Users/jamshidnafisi/Documents/bizbuzz/node_modules/hapi/lib/index.js:5
const Server = require('./server');
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)发布于 2015-11-03 02:41:58
Hapi10.0.0及更新版本需要node.js v4.0.0或更高版本。您使用的是旧版本(v0.12.7)。将您的node.js版本更新为v4或v5,它将工作。您可以在这里下载node.js:https://nodejs.org/en/。
https://stackoverflow.com/questions/33490405
复制相似问题