To install Node.js, navigate to Node.js Homepage, select the option, and download.
For macOS users, you can also use Homebrew to download Node: brew install node
.
To check the current version of Node.js, we can use the command: node -v
.
npm is a Node package manager installed when you install Node.js.
To check the current version of npm, we can use the command: npm -v
.
I recommend installing nodemon
, a useful package that automatically restarts the node application when file changes in the directory are detected.
In this example, we save nodemon as devDependencies.
npm i -D nodemon
Check the nodemon version:
nodemon --version
To install MongoDB, go to https://www.mongodb.com/download-center and choose your version according to the OS.
If you use macOS, you can install MongoDB by Homebrew.
Once you have Homebrew installed, you’ll need to tap the MongoDB formula repository by running the following command in your terminal:
brew tap mongodb/brew
Next, run this command to install MongoDB:
brew install mongodb-community@4.4
To start running Mongo, use this command:
brew services start mongodb
To check the version of MongoDB, run:
mongod --version
I recommend using Visual Studio Code for editing. VS Code will give you a solid editor with customization and useful functionality.
To download VS Code (highly recommended), go to its website at https://code.visualstudio.com.