1.Open a Web Browser Like Chrome, Edge or another
2.Download Node.js on the Web Browser you use or click the following link NodeJS (currently recommended version v20.16.0 (LTS))

3.Download GitBash for the terminal on the website you use or click the following link GitBash
4.Open the GitBash that you downloaded
5.Check your node version (current recommended version v20.16.0 (LTS)) by typingnode -v

6.Create a directory for your project by typingmkdir your-project-name

7.Enter the directory you created by typingcd your-project-name

8.Create a filemain.js(file name as needed) usingechoaccompanied by console.log before the file name

9.Run the file you have created by typingnode main.js

10.See Results
The results will come out like this
11.If editing is required, you can typenodepad main.js

Note:
node -v = view node.js version. minimum version 20
npm -v = to see the npm (package managing) version. minimum version 10
node = running js file
ls = to view the contents of the folder
ls -a = to see all folder contents including hidden ones
DIR = to view the contents of the folder in Windows
mkdir = create folder
cd = to go to folder
cd .. = to exit the folder
touch = to create file (os)
echo 'console.log("hello students")' > main.js (create file)
rm = to delete files (MAC)
del = to delete files (Windows)
Nano / Edit file contents (Only on MAC OS and Linux)
nano = edit file
ctrl + o = save file (enter)
ctrl + x = exit file editing
The above is the detailed content of How To Use Node JS By Displaying (\'Hello World\'). For more information, please follow other related articles on the PHP Chinese website!
What is the purpose of storage management?
How to copy an Excel table to make it the same size as the original
How to set a scheduled shutdown in UOS
How to set path environment variable
How to calculate the refund handling fee for Railway 12306
Solution to computer black screen prompt missing operating system
How to solve the invalid mysql identifier error
How to find the greatest common divisor in C language