Axios与node.js – ReferenceError:XMLHttpRequest未定义

我从一个简单configuration的axios实例触发一个GET请求:

 var Axios = axios.create({ baseURL: myBaseUrl, headers: {'content-type': 'application/json'} }); Axios.get(url) 

并得到以下错误:

 ReferenceError: XMLHttpRequest is not defined at dispatchXhrRequest (C:\...\node_modules\axios\dist\axios.js:804:24) at xhrAdapter (C:\...\node_modules\axios\dist\axios.js:796:11) at process._tickCallback (internal/process/next_tick.js:103:7) at Function.Module.runMain (module.js:577:11) at startup (node.js:160:18) at node.js:456:3 

据我的理解(并根据文档 ),axios应该在web浏览器和node.js上工作。

我错过了什么?

版本:

 node - 6.2.1 axios - 0.13.1 

Solutions Collecting From Web of "Axios与node.js – ReferenceError:XMLHttpRequest未定义"