Nodejs Supertest对象不是函数错误

时间:2015-02-22 15:32:48

标签: javascript node.js http post supertest

在shell脚本执行回调中,我正在向服务发送POST请求,但由于某种原因,我得到Error: [TypeError: object is not a function]。这是我的代码:

exec('./scripts/update.sh', function(err, stdout, stderr) {
  if (!err) {
    request('https://api.rollbar.com')
      .post('/api/1/deploy/')
      .send({
        access_token: token,
        environment: 'production',
        revision: commitSHA
      })
      .end(function(err, res) {
        if (!err) {
          console.log('%s: sent deploy information to Rollbar', (new Date()).toLocaleString());
        }
      });
  }
});

0 个答案:

没有答案