Docs Menu

Docs HomeNode.js Driver

Download and Install


Ensure you have Node.js v16 or later and npm (Node Package Manager) installed in your development environment.

For information on how to install Node.js and npm, see downloading and installing Node.js and npm.


In your shell, run the following command to create a directory called node_quickstart for this project:

mkdir node_quickstart

Run the following command to navigate into the project directory:

cd node_quickstart

Run the following command to initialize your Node.js project:

npm init -y

When this command successfully completes, you should have a package.json file in your node_quickstart directory.


Run the following command in your shell to install the driver in your project directory:

npm install mongodb@6.3

This command performs the following actions:

  • Downloads the mongodb package and the dependencies it requires

  • Saves the package in the node_modules directory

  • Records the dependency information in the package.json file

After you complete these steps, you should have Node.js and npm installed and a new project directory with the driver dependencies installed.


If you run into issues on this step, ask for help in the MongoDB Community Forums or submit feedback using the Share Feedback tab on the right or bottom right side of this page.

Next: Create a MongoDB Deployment
←  Quick StartCreate a MongoDB Deployment →
Share Feedback