UnhandledPromiseRejectionWarning: Unhandled promise rejection.
This error originated either by throwing inside of an async function without a catch block,
or by rejecting a promise which was not handled with .catch()
解决办法: 增加catch
new Promise((resolve, reject)=>{
if(2>1) reject("foo")
resolve("bar")
}).catch(()=>{})
参考
Promise的UnhandledPromiseRejectionWarning问题