使用官网命令安装newman后,查询如下命令报错:
user@conti-del-lp-042:~$ newman -h
/usr/local/lib/node_modules/newman/bin/newman.js:61
let options = util.commanderToObject(command),
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3
解决方案,升级nodejs版本即可。可参考https://blog.csdn.net/maggiehmq3/article/details/78559470,将版本修改为10.X