运行truffle,报错
/usr/local/lib/node_modules/truffle/build/cli.bundled.js:63352
return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();
^^
SyntaxError: Unexpected token if
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:140:18)
at node.js:1043:3
尝试修改源文件,发现错误有点麻烦,后来升级了nodejs,从v4升级到v9,搞定
升级方法见https://blog.csdn.net/gengli2017/article/details/80427943