【发布时间】:2016-08-24 01:55:46
【问题描述】:
我在命令行中执行了meteor npm install --save request
我在代码import {request} from 'request'中导入了请求库
并尝试将其与
一起使用request('http://www.google.com', function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body) // Show the HTML for the Google homepage.
}
})
但是我不断收到以下错误:
undefined is not a function
如何在我的流星应用中使用 npm request 包?
【问题讨论】: