In this section, we will learn:
-
How to install Node js
-
How to set up MongoDB using MongoDB Atlas (cloud-based)
π’ Step 1 Install Node js
Node.js is a JavaScript runtime used to run JavaScript code outside the browser. It is required to run backend applications.
β Installation Steps
-
Search on Google:
shnodejs
-
Click the official website: https://nodejs.org
-
Youβll see two versions:
-
LTS (Long Term Support) β Recommended for most users
-
Current β Includes latest features
-
-
Choose your Operating System (Windows, macOS, Linux) and download the LTS version.
-
Once the download finishes, open the installer and follow the steps:
-
Click Next β Accept License β Click Next β Complete Installation.
-
π§ͺ Verify Installation
Open Command Prompt (CMD) or Terminal and type:
node -v
If it shows the Node.js version, installation was successful.
Then try:
node
Youβll enter the Node.js interactive shell. Type:
2 + 2
You should see:
4
Press
Ctrl + C
twice to exit.
π Diagram: Node.js Installation Flow
Example:
mongodb+srv://testmongodb:<password>@cluster0.mongodb.net/
-
Replace
<password>
with your chosen password
π Save this connection string. Youβll use it in your application code.
β Final Result
Congratulations! π
You have now:
-
Installed Node.js
-
Created a cloud MongoDB database using MongoDB Atlas
-
Got the connection string needed to connect your app