Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(node:6620) DeprecationWarning: process.EventEmitter is deprecated. use require('events') instead. #55

Open
ahysing opened this issue May 26, 2016 · 5 comments · May be fixed by #57
Open

Comments

@ahysing
Copy link

ahysing commented May 26, 2016

As a user of node module robohydra I am experiencing a warning when running on node.js v6.1.0 on windows. The error appears on start of my application, and is listed as a warning.

(node:6620) DeprecationWarning: process.EventEmitter is deprecated. use require('events') instead.

After trail and error I found that the warning disappears if the line https://github.com/LearnBoost/websocket.io/blob/master/lib/socket.js#L6 is changed from

var EventEmitter = process.EventEmitter

to

var EventEmitter = require('events')

websocket.io is used as an external dependancy to robohydra.
All features runs just fine. However no websockets are in use in our system, and I am not capable of testing this change. Please help.

ps: I have noted the maintainers of robohydra. thie issue is filed in robohydra/robohydra#24

@kul1010
Copy link

kul1010 commented Jul 25, 2016

Thanks a lot, Andreas Dreyer Hysing!!!!!!! its working. I have changed where var EventEmitter = process.EventEmitter is defined to var EventEmitter = require('events')

@F1LT3R
Copy link

F1LT3R commented Jan 18, 2017

Also have the same problem:
kavanagh/srvlr#1
markserv/markserv#11

@josvaler
Copy link

josvaler commented May 1, 2017

This also works on OSX-Mac running Node v7.7.4
Be patient, you'll need to change it several times in different .js files.

var EventEmitter = process.EventEmitter
to
var EventEmitter = require('events')

Thanks ahysing, you save my day.

@SylarRuby
Copy link

So which version of node this now supports?

@ghost
Copy link

ghost commented Apr 12, 2018

@josvaler @ahysing

I changed the

var EventEmitter = process.EventEmitter
to
var EventEmitter = require('events')

for different .js files but I found this

Socket.prototype.$emit = EventEmitter.prototype.emit;

It is some kind of function, I have no idea how to change it. The command prompt warn this line has something wrong. Actually, I am trying to use tuio.js(https://github.com/fe9lix/Tuio.js), this problem lead me here. Any solutions for the case? Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants