Nano CouchDB Library: Error happened in your connection #4711
-
I'm trying to incorporate CouchDB into a Node.js backend using the Nano npm library. According to the docs, the connection should be established using
When I run the app, however, it returns to me the error
The docs also indicated that the url may need to contain credentials in the form 'http:admin:password@localhost:5984', but what exactly are the 'admin' and 'password' referring to? Are they the login credentials for my fauxton portal? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@JeffreyQin yeah it can be admin user. Here is how to add a new user: https://docs.couchdb.org/en/stable/intro/security.html#creating-a-new-admin-user At some point in the past (in the 1.x, 2.x era), there was no admin user required by default. That's why there are guides and examples floating around which may not mention it. That all changed in 3.0 if you're interested to learn more: https://blog.couchdb.org/2020/02/26/the-road-to-couchdb-3-0-security/ |
Beta Was this translation helpful? Give feedback.
-
sounds like couchdb is simply not running on the server you are using nano on, or it is not bound to the loopback interface, or it is bound only to ipv4 and you're contacting over ipv6 (::1 is ipv6 for localhost) |
Beta Was this translation helpful? Give feedback.
-
Thank you guys for the answers. I was able to resolve the issue and successfully connect to CouchDB by performing the following changes
Thanks again to both of you :) |
Beta Was this translation helpful? Give feedback.
ECONNREFUSED ::1:5984
is a networking issue, you didn't get as far as making a request, with or without credentials.sounds like couchdb is simply not running on the server you are using nano on, or it is not bound to the loopback interface, or it is bound only to ipv4 and you're contacting over ipv6 (::1 is ipv6 for localhost)