npm启动cloudant数据库连接错误

时间:2018-02-08 09:05:50

标签: javascript node.js

在实施Watson会话时,数据存储在db中。 如果从本地和sns导入数据,您将看到以下错误。

运行本地npm会导致以下错误。

有什么问题?

=============================================== ============================

API初始化

在端口上运行的服务器:3000

cloudant db already exists { Error: The database could not be created, the 
file already exists.

at C:\chatbot\node_modules\cloudant-nano\lib\nano.js:247:15
at Request._callback (C:\chatbot\node_modules\cloudant\plugins\promises.js:43:9)
at Request.self.callback (C:\chatbot\node_modules\cloudant\node_modules\request\request.js:186:22)
at Request.emit (events.js:160:13)
at Request.<anonymous> (C:\chatbot\node_modules\cloudant\node_modules\request\request.js:1060:10)
at Request.emit (events.js:160:13)
at IncomingMessage.<anonymous> (C:\chatbot\node_modules\cloudant\node_modules\request\request.js:980:12)
at Object.onceWrapper (events.js:255:19)
at IncomingMessage.emit (events.js:165:20)
  name: 'Error',
  error: 'file_exists',
  reason: 'The database could not be created, the file already exists.',
  statusCode: 412,
  scope: 'couch',
  request:
   { method: 'PUT',
     headers:
      { 'content-type': 'application/json',
        accept: 'application/json' },
     uri: 'https://XXXXXX:XXXXXX@4192b755-12d0-49c2-94b5-18d748447fd4-
bluemix.cloudant.com/context' },
  headers:
   { 'x-frame-options': 'DENY',
     'x-couch-request-id': 'bb0bfe22e2',
     date: 'Thu, 08 Feb 2018 05:15:32 GMT',
     'content-type': 'application/json',
     'cache-control': 'must-revalidate',
     'strict-transport-security': 'max-age=31536000',
     'x-content-type-options': 'nosniff',
     'x-cloudant-request-class': 'write',
     'x-cloudant-backend': 'bm-cc-us-south-04',
     via: '1.1 lb1.bm-cc-us-south-04 (Glum/1.45.5)',
     statusCode: 412,
     uri: 'https://XXXXXX:XXXXXX@4192b755-12d0-49c2-94b5-18d748447fd4-
bluemix.cloudant.com/context' },
  errid: 'non_200',
  description: 'couch returned 412' 
  }
(node:13468) UnhandledPromiseRejectionWarning: #<Object>
(node:13468) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). 
(rejection id: 1)
(node:13468) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

0 个答案:

没有答案