"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Tutorial on how to use node.js to display \"Hello World\"

Tutorial on how to use node.js to display \"Hello World\"

Published on 2024-08-31
Browse:800

Tutorial cara memakai node.js sampai memunculkan \

  1. Installing Node.js Open Browser: Open Google Chrome or Microsoft Edge. Download Node.js: Visit the Node.js website. Select the latest version that suits your operating system, for example Windows 64-bit. Click on the latest version (for example, version 2.46.0) to download the installer. Install Node.js: Once the download is complete, open the installer file. Follow the installation steps displayed on the screen. Once complete, Node.js and npm (Node Package Manager) will be installed on your system.
  2. Checking Node.js Installation Open Command Prompt (CMD): Press Win R, type cmd, and press Enter. Check Node.js version: Type node -v and press Enter. This will display the installed version of Node.js. Check npm version: Type npm -v and press Enter. This will display the npm version installed.
  3. Create and Run the "Hello World" Program Create New Folder: In Command Prompt, type mkdir HelloWorld and press Enter. This will create a new folder called "HelloWorld". Go to Folder: Type cd HelloWorld and press Enter to enter the folder. Create a New JavaScript File: Type echo console.log('Hello World!') > app.js and press Enter. This will create a new file called app.js with code that displays "Hello World!" inside it. Run Program: Type node app.js and press Enter. You will see the text "Hello World!" appears on the screen.
  4. Finished! You have successfully run the "Hello World" program using Node.js. Next, you can start experimenting further with Node.js to develop more complex applications.
Release Statement This article is reproduced at: https://dev.to/muhammad_fazlemalino_f24/tutorial-cara-memakai-nodejs-sampai-memunculkan-hello-world-4fem?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3