ConnectorError: connector "bookshelf" not found: Cannot find module 'strapi-connector-bookshelf' during database migration

Viewed 7
[2022-09-07T18:51:13.130Z] error ConnectorError: connector "bookshelf" not found: Cannot find module 'strapi-connector-bookshelf'
Require stack:
- /srv/app/node_modules/strapi-database/lib/require-connector.js
- /srv/app/node_modules/strapi-database/lib/connector-registry.js
- /srv/app/node_modules/strapi-database/lib/database-manager.js
- /srv/app/node_modules/strapi-database/lib/index.js
- /srv/app/node_modules/strapi/lib/Strapi.js
- /srv/app/node_modules/strapi/lib/index.js
- /srv/app/node_modules/strapi/lib/commands/develop.js
- /srv/app/node_modules/strapi/bin/strapi.js
    at requireConnector (/srv/app/node_modules/strapi-database/lib/require-connector.js:21:11)
    at Object.load (/srv/app/node_modules/strapi-database/lib/connector-registry.js:20:38)
    at DatabaseManager.initialize (/srv/app/node_modules/strapi-database/lib/database-manager.js:37:21)
    at Strapi.load (/srv/app/node_modules/strapi/lib/Strapi.js:354:19)
    at async Strapi.start (/srv/app/node_modules/strapi/lib/Strapi.js:196:9)
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I was following the migration tutorial found here: https://docs.strapi.io/developer-docs/latest/update-migration-guides/migration-guides/v4/data/mongo.html#prepare-the-migration-locally

These are my dependencies:

  "dependencies": {
    "knex": "0.21.19",
    "pg": "8.7.3",
    "remark": "^13.0.0",
    "strapi": "3.6.8",
    "strapi-admin": "3.6.8",
    "strapi-connector-bookshelf": "3.6.9",
    "strapi-plugin-content-manager": "3.6.8",
    "strapi-plugin-content-type-builder": "3.6.8",
    "strapi-plugin-email": "3.6.8",
    "strapi-plugin-graphql": "3.6.8",
    "strapi-plugin-upload": "3.6.8",
    "strapi-plugin-users-permissions": "3.6.8",
    "strapi-utils": "3.6.8",
    "strip-markdown": "^4.0.0"
  },

This is my connector:

{
  connector: 'bookshelf',
  settings: {
    client: 'postgres',
    database: 'cms',
    username: 'bogus_user',
    password: 'bogus_pw',
    port: 5432,
    host: 'localhost',
  },
  options: {},
}

However, even though I followed the steps, the bookshelf config is throwing an error, and I can't figure out what's causing this. I am guessing it's some dependencies issues because the error is thrown inside node_modules, but I am not sure how to fix it since in the config there's nothing to be done.

  "dependencies": {
    "knex": "0.21.19",
    "pg": "8.7.3",
    "remark": "^13.0.0",
    "strapi": "3.6.9",
    "strapi-admin": "3.6.9",
    "strapi-connector-bookshelf": "3.6.9",
    "strapi-plugin-content-manager": "3.6.9",
    "strapi-plugin-content-type-builder": "3.6.9",
    "strapi-plugin-email": "3.6.9",
    "strapi-plugin-graphql": "3.6.9",
    "strapi-plugin-upload": "3.6.9",
    "strapi-plugin-users-permissions": "3.6.9",
    "strapi-utils": "3.6.9",
    "strip-markdown": "^4.0.0"
  },

Tried updating to the latest v3 version by doing yarn install after the package.json changes and same error.

0 Answers
Related