As mentioned in the previous answer, you have to run testrpc first. If testrpc is running and still you get this error then make sure that you have added the port number of testrpc right. By default, testrpc will run on port 8545, so your truffle.js file should look something like this:
module.exports = {
networks: {
development: {
//Other entries
port: 8545,
// Remaining entries
}
}
};
Hope these information helps.
To know more, enroll with our Blockchain online training without fail.
Thanks.