javascript - DeprecationWarning process.EventEmitter is deprecated -


already applied require('events') still warning keep showing, doing wrong here? why process.eventemitter keep showing not used?

node v6.7.0 works, v6.9.1 happening on centos 7.2

var pro = require('events'); var port = parseint(config.server.port, 10); var io = require('socket.io').listen(port); // line causing it??? 

output warning:

dev environment detected    info  - socket.io started (node:32708) deprecationwarning: process.eventemitter deprecated. use require('events') instead. 

edit:

i used $ npm install package.json had following:

{   "name": "test",   "description": "test",   "version": "0.0.2",   "dependencies": {     "getconfig": "0.3.0",     "node-uuid": "1.2.0",     "socket.io": "0.9.16",     "yetify": "0.0.1"   },   "main": "test.js",   "repository": {     "type": "git",   },   "devdependencies": {     "socket.io-client": "0.9.16",     "precommit-hook": "0.3.10",     "tape": "^2.13.1"   },   "scripts": {     "test": "node test.js"   } } 

you may using , old version of socket.io because in code don't use process.eventemitter directly. if program posted shows warning problem.

on system same program doesn't cause problem - node 7.0.0 , socket.io 1.5.1 - maybe didn't include of code in example (e.g. config.server.port not defined seem have removed portions of code may relevant here).

you can see version you're using in:

node_modules/socket.io/package.json 

see own package.json , search line like:

"socket.io": "^1.4.8" 

(like this line in 1 of projects on github) see version installed npm install , update version if it's outdated. it's possible have socket.io module installed globally.

you can use david let know have outdated dependencies.

you can use greenkeeper keep dependencies date.

(it's add snyk let know vulnerabilities in dependencies.)

update

you posted package.json , indeed use old version of socket.io:

"socket.io": "0.9.16", 

so exact version installed when run npm install. current version 1.5.1 - see:

you can change version , rerun npm install. if code same posted shouldn't need change code. if there more code see http://socket.io/docs/migrating-from-0-9/ things may need changed.

if use ci tests, david , greenkeeper, suggest above, of (updating version, testing if still works etc.) done automatically.

if use snyk, suggest above, you'll know version of socket.io you're using has high-severity vulnerabilities, including denial of service , remote memory exposure - have in code. see:

so can see, updating socket.io dependency important more serious reasons deprecation warning.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -