Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2024-08-24 11:23:36
Original
452 people have browsed it

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 finished, 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 show the version of npm 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. Done! 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.

The above is the detailed content of Tutorial on how to use node.js to display \'Hello World\'. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!