Couchdb runs fine through the command prompt, however, when I try to access a db through nano I get a ECONNREFUSED error.
I am using nano version 10.0.0 and I have couch db installed locally and running on port 5984.
Here is my code:
const nano = require("nano")(`http://${user}:${pass}@localhost:5984`);
const db = nano.db.use("patients")
db.info().then(console.log)
Upon running the code I get:
error - unhandledRejection: Error: error happened in your connection. Reason: connect ECONNREFUSED ::1:5984
at responseHandler (/Users/omoscow/Documents/GitHub/Trustee-Community/node_modules/nano/lib/nano.js:144:16)
at /Users/omoscow/Documents/GitHub/Trustee-Community/node_modules/nano/lib/nano.js:442:13
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
This code used to work fine. Any ideas on whats going wrong?