'How to run live server after Node.js and npm installation

I am using Windows 10 and I have installed Node.js (with npm) on my local machine. I am trying to follow an instruction which says:

"Once node.js and npm are installed, run the following command in your terminal.

npm install -g live-server

This will install live-server⁵, a simple static server that has live reload built-in. To
start your server, run live-server in your terminal from the root /code folder —
it will even open a new browser window for you!"

Since I am on Windows, I guess "Terminal" means "Command Prompt". So, I have run the "npm install -g live-server" from C:// prompt.

I am now confused about the part where it says "run live-server in your terminal from the root /code folder".

What is the root /code folder?



Solution 1:[1]

In the command prompt, either cmd.com or Windows terminal (yes, the new one actually has the word "terminal" in its name), cd to your project directory (referred to by the docs as the "root" or "code" folder) then type:

live-server

It is literally installed as a command just like cd, dir etc.

The "root" folder or "code" folder is literally the folder where you saved your index.html file.

Solution 2:[2]

Root folder is where your index.html is saved.(from which your code runs). You can use cd ../ to change your folder and get to root. After which you can easily run live server.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 ankitkaushiks