mafintosh / mafintosh/curly

process.EventEmitter (index.js:51) is deprecated/removed in later versions of node

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
14
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Using curly in Node V6.9.1 I receive:

`DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead.`

This is coming from line 51 in index.js:
`Request.prototype.__proto__ = process.EventEmitter.prototype;`

In version 7, process.EventEmitter has been removed and this line throws an error.

`Request.prototype.__proto__ = process.EventEmitter.prototype;`
`TypeError: Cannot read property 'prototype' of undefined`

Replacing with `Request.prototype.__proto__ = require('events').prototype;` seems to work.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at index.js line 51 and inspect how Request inherits from the event emitter. Reproduce the warning on Node 6.9.1 and the failure on Node 7, then verify that the request module works without using the removed process.EventEmitter API.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.