Docs Menu
Docs Home
/ / /
Node.js Driver
/

Download and Install

1

Ensure you have Node.js v16.20.1 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.

2

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 have a package.json file in your node_quickstart directory.

3

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

npm install mongodb@6.12

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 have Node.js and npm installed and a new project directory with the driver dependencies installed.

Note

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

Back

Quick Start