问题
I've cloned some guy's web app and am trying to run the .js script they provided to extract data from a database. While I can run the project as a whole without a hitch, this particular script produces an error:
{ CouchError: not_found: Database does not exist.
at Request._onResponse [as _callback] (c:\Users\bzlis\Documents\coup\node_modules\cradle\lib\cradle.js:241:29)
at Request.self.callback (c:\Users\bzlis\Documents\coup\node_modules\request\request.js:185:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (c:\Users\bzlis\Documents\coup\node_modules\request\request.js:1161:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (c:\Users\bzlis\Documents\coup\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
name: 'CouchError',
message: 'not_found: Database does not exist.',
error: 'not_found',
reason: 'Database does not exist.',
headers:
{ 'cache-control': 'must-revalidate',
'content-length': '58',
'content-type': 'application/json',
date: 'Tue, 09 Apr 2019 22:38:11 GMT',
server: 'CouchDB/2.3.1 (Erlang OTP/19)',
'x-couch-request-id': '4a10e74b05',
'x-couchdb-body-time': '0',
status: 404 } }
Now, a quick Google search will reveal that this is a pretty common problem. The most common source appears to be an error in CouchDB 2.0 which requires people to do some manual setup _user thing - I don't believe that's the case, as I have CouchDB 2.3.0, and this _user step is not mentioned in the installation guide.
Other answers include stuff like adding yourself as an admin, or something with curl.
This project isn't mine, and moreover, I'm not a front-end developer. I'm sorry if my specific issue has actually been answered before.
回答1:
Please follow the documentation on setting up CouchDB. It is necessary to create a few databases before using your CouchDB cluster. The instructions to follow depend on whether you're using a single-node configuration, or a clustered configuration.
来源:https://stackoverflow.com/questions/55602347/users-database-does-not-exist