- Visual Studio installed on your machine. If you don’t have it, you can download it from here.
- Node.js installed on your machine. If you don’t have it, you can download it from here.
Creating a new project
First, we’ll create a new project in Visual Studio:
- Open Visual Studio.
- Click on File > New > Project….
- In the “New Project” window, select Blank Node.js Console Application, give your project a name and location, and click on OK.
This code simply outputs “Hello, World!” to the console.
- Click on Debug in the top menu.
- Select Start Debugging (or press F5 on your keyboard).
Visual Studio will start a new Node.js process and execute your code. The output will be displayed in the Output window at the bottom of the screen.