Express.js Installation

Express.js Installation

Follow the process mentioned below in order to install Express.js on your device.

Step 1: Download .msi file of Node.js from nodejs.org according to your system requirements.

Express.js Installation

After then click on Next.

Express.js Installation

Click on I accept the terms in the License agreement box and then proceed further by clicking on Next.

Express.js Installation

Now, click on Install to Install Node.js.

Express.js Installation

Step 2: Run command prompt (cmd.exe).

Step 3: Type node –v to check if the node is deployed successfully. It should respond with v#.#.#. Restart your system if it responds incorrectly.

Express.js Installation

Step 4:  Install and update all dependencies automatically by typing the "npm install” command.

Express.js Installation

Step 5: Execute the "node app" to run the server with the server root folder.

Step 6: Allow access to the application through the Windows Firewall.

  • Go to "Control Panel > System Security > Windows Firewall > Advanced Settings".
  • Now create a new rule.
  • Select “Port” and then click “Next."
Express.js Installation
  • Now allow TCP and All local ports and click on “Next”.
Express.js Installation
  • Select "Allow the connection" and press "Next".
Express.js Installation
  • Check all Domain, Private, and Public followed by clicking “Next”.
Express.js Installation
  • Now type "Acne Challenge Server" in the name section, and press "Finish".
Express.js Installation

Step 7: Restart Operating System.

Step 8: Open cmd and type “cmd” and then hit “Enter”.

Step 9: Run "node app" from within the high scores directory.

Step 10: The server is ready.

After the successful installation of node.js on your computer, now install Visual Studio Code editor on your device and do project setup in Visual Studio Code. Following is the detailed procedure to download and install the Visual Studio Code.

Installing and Project Setup in Visual Studio Code

Visual Studio Code is a free source code editor. It is developed by Microsoft. It has various features like syntax highlighting, support for debugging. We will use this code editor for Express.js.

Following is the process to install the Visual Code Studio.

Step 1: In your browser, open the official website of Visual Studio Code www.code.visualstudio.com.

Express.js Installation

Step 2:  Click on the download button (in red circle) according to the requirement of your system. As I am using the Windows operating system, so I am choosing the Download for Windows option. If you are using Linux or Mac, then you can choose according to your OS.

Express.js Installation

Step 3: Click on the downloaded file. It will open the folder where the download is saved.

Express.js Installation

Step 4: Double click on the file and click on the license agreement box to accept the agreement, and after that, click on Next.

Express.js Installation

Step 5: Select the location where you want your file to be installed and then click on the Next.

Express.js Installation

Step 6: Select the folder where the setup shortcut will create and click on Next.

Express.js Installation

Step 7: Now select the options you want to be in setup and click on Next.

Express.js Installation

Step 8: Click on Install.

Express.js Installation
Express.js Installation

Step 9: Click on Finish.

Express.js Installation

Visual Studio code will be deployed on our computer.

How to open the Express.js project in Visual Studio code?

You can easily deploy the Express.js project in Visual Studio Code by the following process.

Step 1:  Now Open Visual Studio code.

Express.js Installation

Step 2: Click on the Open folder as shown above, then select the folder after and click on the Select folder.

Express.js Installation

Step 3: As you can see below, your project id is now open in the Visual Studio Code.

Express.js Installation

Now, your Visual Studio Code editor is ready to work. You can deploy your project here and code very efficiently.