Installing MERN Software

The programming projects for this class require you to install Node.js and MongoDB. If you don't already have these packages installed on your laptop, follow the instructions below to install them.

Installing Node.js

Install the latest "Long Term Support (LTS)" version of Node.js (currently version 18.15.0). It can be downloaded from the URL https://nodejs.org/en/download. To verify you have Node.js and its package manager (npm), try running the commands:

node -v
and:
npm -v
which should run and print out the version numbers of your node and npm programs.

Installing MongoDB

Install the MongoDB Community Edition from the website https://docs.mongodb.com/manual/administration/install-community/.

Once you start the MongoDB server using the command

mongod (the exact arguments depend on where you placed the database)
MongoDB needs a folder/directory to store the database. Depending on how you installed MongoDB, you may need to create a folder. For example, on MacOS you could create the folder /usr/local/var/mongodb and run MongoDB with the command:
mongod --dbpath /usr/local/var/mongodb
you should be able to directly interact with the MongoDB database by running the command:
mongosh
Type help at the command prompt to see the available commands.

For Windows users, you may need to add the location of where MongoDB was installed to your environment path variable in order to run the commands. This is usually located at

C:\Program Files\MongoDB\Server\<version_number>\bin