Link: https://www.linode.com/docs/guides/nodejs-twitter-bot/
Issue
The support for the streaming endpoint that the Twit package uses has been deprecated by Twitter. So your code is not working with the latest v2 endpoint.
##suggested fix
use twitter-api-v2 library.