Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Upgrade to v10.0.0 and cannot check migrate mongo version #435

Open
coroo opened this issue May 4, 2023 · 1 comment
Open

[BUG] Upgrade to v10.0.0 and cannot check migrate mongo version #435

coroo opened this issue May 4, 2023 · 1 comment

Comments

@coroo
Copy link

coroo commented May 4, 2023

Describe the bug
I just update the v10.0.0 and got an error when checking version.

To Reproduce
Steps to reproduce the behavior:

  1. Update to version 10.0.0
  2. run this script:
migrate-mongo --version
  1. It will return the error:
internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'mongodb'
Require stack:
- /Users/kuncorowicaksono/.nvm/versions/node/v14.17.6/lib/node_modules/migrate-mongo/lib/env/database.js
- /Users/kuncorowicaksono/.nvm/versions/node/v14.17.6/lib/node_modules/migrate-mongo/lib/migrate-mongo.js
- /Users/kuncorowicaksono/.nvm/versions/node/v14.17.6/lib/node_modules/migrate-mongo/bin/migrate-mongo.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/Users/kuncorowicaksono/.nvm/versions/node/v14.17.6/lib/node_modules/migrate-mongo/lib/env/database.js:1:25)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/kuncorowicaksono/.nvm/versions/node/v14.17.6/lib/node_modules/migrate-mongo/lib/env/database.js',
    '/Users/kuncorowicaksono/.nvm/versions/node/v14.17.6/lib/node_modules/migrate-mongo/lib/migrate-mongo.js',
    '/Users/kuncorowicaksono/.nvm/versions/node/v14.17.6/lib/node_modules/migrate-mongo/bin/migrate-mongo.js'
  ]
}

Expected behavior
Return the version of migrate-mongo, e.g. 9.0.0

@coroo coroo changed the title Upgrade to v10.0.0 and cannot check migrate mongo version [BUG] Upgrade to v10.0.0 and cannot check migrate mongo version May 4, 2023
@Juuldamen
Copy link

Juuldamen commented Jun 16, 2023

Same error when I run migrate-mongo up with v10 globally installed in a Docker container with image node:14-alpine. The repository has mongoose@5.12.12 installed which also requires mongodb@3.6.8, defined in the package-lock.json file. I can see it locally for the repository in node_modules/mongodb.

EDIT: Seems that v10 (e4d9446) of this package now requires MongoDB 4 or 5 as a peer dependency. With Node 14 peer dependencies aren't automatically installed so it so it cannot find a mongodb installation which matches this condition since I'm still using mongodb@3.6.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants