Error: connect ECONNREFUSED 127.0.0.1:8332 I get this error:

{ Error: connect ECONNREFUSED 127.0.0.1:8332
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 8332 }


when I use this code:

var bitcoin = require('bitcoin');
var client = new bitcoin.Client({
    host: 'localhost',
    port: 8332,
    user: 'Rohit',
    pass: '12345'
});
I hadn't started bitcored service ..that's why this error occurs
when I started, the error had gone

i followed these steps that given here

Anyway thanks**