Node.js http get请求会在工头提前退出

编辑:正如已经指出的,这个代码实际上直接通过节点运行良好 – 我现在意识到,问题是当我试图运行与领class,这是Heroku工具包的一部分。 有谁知道为什么我应该得到一个不同的结果时,与工头命令运行?

我正在尝试使用Node.jsparsingXML提要。 我到目前为止的代码只是为了获得XML饲料块和输出到控制台。 出于某种原因,每当我运行它,我得到一个“退出代码0”“发送SIGKILL所有进程”消息在随机点(每次运行不同)。 该消息散布在xml的最后几行(输出示例结束)中:

01:17:55 web.1 | </item> 01:17:55 web.1 | exited with code 0 01:17:55 web.1 | <item> 01:17:55 system | sending SIGKILL to all processes 01:17:55 | <title>The Church of Scot C:\CK3\dashboard> 

有谁知道什么可能导致这个提前退出? 这是我的代码

 var http = require('http'); //var xml2js = require('xml2js'); var options = { host: 'feeds.bbci.co.uk', port: 80, path: '/news/rss.xml' }; var req = http.get(options, function(res) { //console.log('STATUS: ' + res.statusCode); //console.log('HEADERS: ' + JSON.stringify(res.headers)); res.setEncoding('utf8'); res.on('data', function (chunk) { console.log("\n\n new chunk \n\n"); console.log(chunk); }); }); req.on('error', function(e) { console.log('problem with request: ' + e.message); }); req.end(); 

非常感谢您的时间和回应!

-Sixhobbits