Usually we need some IDE to create a node js application; eg., JetBrain, Eclipse, but in case we are looking forward to creating a node js application in Visual Studio Code (free IDE from Microsoft) then there is a drawback that it does not provide us a feature to create an application folder structure and is more like a Code Editor with debugging feature.
In order to do create a folder structure, you would have to install Express Generator package in you system.
- Open CMD in Administrator mode.
- Run the command - npm install express-generator -g . This will install the package globally in your system and you would not need to install it again.
Now create a folder in which you need to create your application. Now follow the below steps:
- Open CMD in Administrator mode.
- Run the command express TestApp. Here TestApp is the name of the application. This will create the folder structure.
- Now run the command npm install. This will install all the required dependecies. Admin mode is required for this to install else it will give you an error.
- Now run the command npm start. This will start the application.
You can now go to the url : http://localhost:3000/ to see the output.