node.js中遇到SyntaxError: Use of const in strict mode

针对node.js的项目,在使用npm install时候,出现SyntaxError: Use of const in strict mode;的报错,通过查看node版本,发现此时系统版本为v0.12.7,因为node.js项目中采用了ES6或ES7最新的语法,使用了类似于constletuse strict等新的语法。采用的方法是,升级系统的node版本,升级到最新的v12.10.0版本,然后重新运行npm install,能正常运行,没有出现错误。

你可能感兴趣的:(node.js,SyntaxError:,Use,of,const,in,strict,node.js)