redis / redis/node-redis

TypeError: net.isIP is not a function

Open
#1,440 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
17.6k
Forks
2k
Avg merge
2d 3h
Merged PRs (30d)
40

Description

Thanks for wanting to report an issue you've found in node_redis. Please delete
this text and fill in the template below. Please note that the issue tracker is only
for bug reports or feature requests. If you have a question, please ask that on [gitter].
If unsure about something, just do as best as you're able.

Note that it will be much easier to fix the issue if a test case that reproduces
the problem is provided. It is of course not always possible to reduce your code
to a small test case, but it's highly appreciated to have as much data as possible.
Thank you!

  • Version: What node_redis and what redis version is the issue happening on? 2.8.0
  • Platform: What platform / version? (For example Node.js 0.10 or Node.js 5.7.0 on Windows 7 / Ubuntu 15.10 / Azure) Windows
  • Description: Description of your issue, stack traces from errors and code that reproduces the issue

Hi Folks,
I'm trying to create Redis Client using this
var redis = require('redis');
var redisClient = redis.createClient({host:'127.0.0.1', port:6379});

but it throws me this errors
else {
82 | cnx_options.port = +options.port || 6379;
83 | cnx_options.host = options.host || '127.0.0.1';

84 | cnx_options.family = !options.family && net.isIP(cnx_options.host) || (options.family === 'IPv6' ? 6 : 4);
| ^ 85 | this.address = cnx_options.host + ':' + cnx_options.port;
86 | } // Warn on misusing deprecated functions
87 |

Please anyone suggest any workaround on this.

Thanks
[gitter]: https://gitter.im/NodeRedis/node_redis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge

Contributor guide

Open the contributing guide

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 by reproducing redis.createClient({host:'127.0.0.1', port:6379}) with node-redis 2.8.0 on Windows, then inspect the connection setup containing the net.isIP call shown in the trace. Done means the client initializes without the reported TypeError and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, redis
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.