Registry / database / mongodb-version-manager

mongodb-version-manager

JSON →
library1.5.0jsnpmunverified

CLI tool and library to install and manage multiple versions of MongoDB locally. Version 1.5.0 is the latest release. It downloads MongoDB binaries from official sources, stores them under ~/.mongodb/versions, and symlinks a current version. Primarily used for testing and development across different MongoDB versions. Offers commands like use, url, available, and path. Simpler than Docker-based solutions but limited to official MongoDB builds and lacks ecosystem support like mongodb-runner.

npm install mongodb-version-manager
INSTALL
IMPORT
SIG · MONGODB-VERSION-MA
M
mongodb-version-manager
databasejavascriptv1.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

m (CLI)
npm install -g mongodb-version-manager
The package provides a global command `m` for managing MongoDB versions. Not a programmatic API.
m use <version>
m use 4.0.0
m install 4.0.0
The command is `m use`, not `m install`.
m available
m available --stable
m list
Use `m available` to list versions; filters like --stable, --unstable, --rc, --pokemon exist.

Installs globally, downloads MongoDB 4.0.0 enterprise, prints binary path, updates PATH, and verifies installation.

npm install -g mongodb-version-manager && m use 4.0.0 --enterprise && m path && export PATH=~/.mongodb/versions/mongodb-current/bin:$PATH && mongod --version
Debug
Known issues
breakingAfter installation, m path may return outdated symlink if current symlink is not updated automatically.
fix
Run `m use` again to re-symlink or manually check ~/.mongodb/versions/mongodb-current.
affects: >=1.0.0
gotchaThe package only supports official MongoDB builds. Custom forks or patch versions are not available.
affects: >=1.0.0
gotchaOn Windows, PowerShell commands need to be adapted; PATH update is not automated.
fix
Use setx PATH to add ~/.mongodb/versions/mongodb-current/bin or update system environment manually.
affects: >=1.0.0
deprecatedThe `m pokemon` flag may be removed in future versions; it's an Easter egg.
affects: <2.0.0
Errors
Common errors & fixes
Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/mongodb-version-manager'
Installed without sudo or nvm, causing permission issues on global modules.
fix
Use nvm to manage Node.js and global packages, or run with sudo (but prefer fixing permissions).
m: command not found
Global npm install path not in PATH.
fix
Add `export PATH=$(npm bin -g):$PATH` to .bashrc or use nvm.
Error: Could not find MongoDB version matching '4.0.0'
Version string not available or incorrect syntax.
fix
Check `m available --stable` for exact version names; use format like '4.0.0' or '4.2.0-rc1'.
Error: Failed to download MongoDB. HTTP error 404
MongoDB build not published for that combination of version/arch/distro.
fix
Try without --enterprise, or use a different version. Check supported distros on MongoDB download center.
Upgrade
Version history
1.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
mongodb-version-manager — npm install mongodb-version-manager · libregistry