LearnBoost / websocket.io

329 stars 59 forks source link

EventEmitter = process.EventEmitter is no longert valid for Node > 6.x #63

Closed hawkeye64 closed 5 years ago

hawkeye64 commented 6 years ago

My approach to fixing this does not break any backwards compatibility for Node < 6.x. I have incorporated the "semver" library to determine if the version of Node being used should be one way or the other for event emitters.

Node < 6.x: var EventEmitter = process.EventEmitter

Node >= 6.0.0 var EventEmitter = require('events')

I am using this in production.

hawkeye64 commented 6 years ago

If someone can tell me why Travis is failing on the "semver", it'd be appreciated.

ghxst44 commented 6 years ago

@hawkeye64 Looks like a very old node version in Travis config. Issue with old npm version may be to blame. From the Travis log:

$ node --version
v0.8.28
$ npm --version
1.2.30