SpiderStrategies / node-tweet-stream

Node twitter module to hook into the public filter streaming, seamlessly updating the tracking keywords.
210 stars 43 forks source link

node-tweet-stream possible eventemitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit #49

Open karlarnejo opened 7 years ago

karlarnejo commented 7 years ago

Hello everyone I am new to node.js and the twitter API but i am certain that i have followed every step in https://www.npmjs.com/package/node-tweet-stream. I have two laptops. The code in the provided link seems to be working just fine in my first laptop (can retrieve tweets). But when i recreate the same steps in my second laptop, it gives me the error in the picture. Maybe its because of security privileges? I tried uninstalling and installing(npm cache-clean->uninstall->restart->reinstall->restart) nodejs on my second laptop but it is still not working. And yes i did "Run as administrator" in cmd before doing anything else. Please help thank you! :)

I also did these above the "var Twitter = require('node-tweet-stream')" but still no avail.

 var y = require('events').EventEmitter.defaultMaxListeners = 0
 var y = require('events').EventEmitter.defaultMaxListeners = 100

First laptop - windows 10 Second laptop - windows 10

Here is my code:

var Twitter = require('node-tweet-stream')
  , t = new Twitter({
    consumer_key: '',
    consumer_secret: '',
    token: '',
    token_secret: ''
  })

t.on('tweet', function (tweet) {
  console.log('tweet received', tweet)
})

t.on('error', function (err) {
  console.log('Oh no')
})

t.track('nodejs')
t.track('pizza')

// 5 minutes later
t.track('tacos')

// 10 minutes later
t.untrack('pizza')

twitter error

gawmanarnar commented 7 years ago

I'm also getting the same thing

m0atz commented 7 years ago

I get the same issue also. Any updates?

Catzilla commented 6 years ago

Getting same warning about memory leak after multiple stall reconnects.

node v8.9.4 node-tweet-stream v2.0.3 windows 10

railton-matthew-by commented 4 years ago

I am also getting this issue. I assumed that using untrack or untrackall then track would not increase the listener count.