0

Node.js don't connecting to memcached server by using unix socket

/var/run/memcached/memcached.sock

I'm using this example code to connect memcached server

var Memcached = require('memcached');

var mem = new Memcached('/var/run/memcached/memcached.sock');

mem.set('ping', 'Hello World', 60, function (err) {
    if (!err)
        mem.get('ping', function (err, data) {
            if (!err)
                console.log(data);
        });
});

How to solve this issue?

Temüjin
  • 15,371
  • 8
  • 35
  • 57

1 Answers1

1

Node.js MemCached unix socket bug fixed here.

Just use this command line to install working version

npm install git+https://git@github.com/ChandraNakka/memcached.git --save
Temüjin
  • 15,371
  • 8
  • 35
  • 57
  • You should post a pull request, because otherwise It will be a pain to do it everytime you wish to update, or if you're installing your app in other server. – Marcos Casagrande May 26 '18 at 16:57
  • @MarcosCasagrande they are rejected by pull request with no reason. That's why I'm writing this post – Temüjin May 26 '18 at 16:59
  • Never said you shouldn't answer :), then you should probably use a fork on your project. – Marcos Casagrande May 26 '18 at 17:01
  • Yes bro, I'm already forked with this patch. But, this post for upcoming people to save their time from this bug. I'm already wasted upto 3 hours to find out this bug. – Temüjin May 26 '18 at 17:03