TypeError: Cannot read property 'toString' of undefined
at Parser.exports.Parser.Parser.parseString (/Users/cos800/projxxx/node_modules/xml2js/lib/xml2js.js:497:18)
at Parser.parseString (/Users/cos800/projxxx/node_modules/xml2js/lib/xml2js.js:7:59)
at Object.exports.parseXML (/Users/cos800/projxxx/node_modules/weixin-pay/lib/util.js:11:9)
at Request._callback (/Users/cos800/projxxx/node_modules/weixin-pay/lib/wxpay.js:75:8)
at self.callback (/Users/cos800/projxxx/node_modules/request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.start (/Users/cos800/projxxx/node_modules/request/request.js:757:10)
at Request.write (/Users/cos800/projxxx/node_modules/request/request.js:1511:10)
at end (/Users/cos800/projxxx/node_modules/request/request.js:552:18)
at Immediate.<anonymous> (/Users/cos800/projxxx/node_modules/request/request.js:581:7)
at runCallback (timers.js:570:20)
at tryOnImmediate (timers.js:550:5)
at processImmediate [as _immediateCallback] (timers.js:529:5)
undefined
我的代码是这样:
然后输出错误: