创建了第二个临时的bandi应用程序,该应用程序从一开始就成功使用mongodb(因此我在本地运行了一个很好的mongo实例)
将temp.working-mongodb.strapi应用程序中的database.json内容复制到我现有的应用程序中。 (确保已在开发中并运行开发版本)
在我现有的应用程序(我想从该应用程序中使用mongodb)中,我
未安装:
strapi-hook-bookshelf
strapi-hook-knex
knex
sqlite3
安装了吊带钩猫鼬
(node:37499) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
(node:37499) UnhandledPromiseRejectionWarning: TypeError: orm.load(...).buildQuery is not a function
at buildQuery (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-utils/lib/buildQuery.js:122:21)
at Object.count (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-plugin-users-permissions/config/queries/mongoose.js:18:12)
at Object.initialize (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-plugin-users-permissions/services/UsersPermissions.js:502:8)
at module.exports (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-plugin-users-permissions/config/functions/bootstrap.js:156:65)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:37499) 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:37499) [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.
[2019-07-03T18:27:15.985Z] warn The bootstrap function is taking unusually long to execute (3500 miliseconds).
[2019-07-03T18:27:15.986Z] warn Make sure you call it?
What am I doing wrong? ?
答案 0 :(得分:1)
这太酷了!我可以回答我自己的问题! ?
尽管如此,我很认真地回答我自己的问题,以帮助可能遇到同一问题的其他人。
底线:我安装了错误的strapi-hook-mongoose
版本。
详细信息::安装strapi-hook-mongoose
时,我没有指定版本,因此,npm安装了^3.0.0-alpha.13
,这是由于我现有的bandi专案位于(当时)最新的v3.0.0-beta.7
上,因此无法执行(产生上述说明中的错误)。
解决方案::卸载软件包并重新安装, 明确指定 版本?
npm i strapi-hook-mongoose@3.0.0-beta.7
?