Usually, a live server is launched from its extension in VS code. But there is another way where you can launch your web pages in a browser and edit them live.
Things needed to achieve this:
- Npm.
- No prior CLI knowledge is required.
If you don't know what npm is and how to install it.
Npm is a package manager and it helps us install and maintain versions of packages(apps, software, extensions). It is a cli-based interface where with just a bit of commands you can install any package directly to your preferred directory.
To install npm:
- install Node.js in your computer
- open node.js terminal
- type this command in your windows terminal
Installing npm (caution: happens only when node.js is installed)
npm install
After installing it you are ready to go
- Open your computer terminal and type the below given code
To install Live Server
npm install -g live-server
Finally use this command to launch the website
live-server
Use the above code in the directory where your webpage is stored.