我对javascript代码有疑问
(node:3302) DeprecationWarning: Collection#find: pass a function instead
(node:3302) UnhandledPromiseRejectionWarning: SqliteError: file is not a database
at newConnection (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/functions/fetch.js:16:10)
at Promise (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/functions/fetch.js:47:5)
at new Promise (<anonymous>)
at Object.module.exports [as fetchDebug] (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/functions/fetch.js:5:19)
at executeQueue (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/queue.js:25:25)
at Promise (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/queue.js:42:7)
at new Promise (<anonymous>)
at Object.fetch (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/queue.js:41:12)
at Client.client.on (/app/bot.js:53:26)
at emitOne (events.js:121:20)
(node:3302) 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: 2)
(node:3302) [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 :(得分:-1)
它说file is not a database
,因此请确保文件路径正确。也许您忘记了将.db
作为文件扩展名。
还要确保您的程序具有访问数据库的权限。教程:for Windows,for Mac/Linux
下次您遇到这种情况时,请阅读程序给您的错误。它旨在帮助您。