Installing Node.js and Running Your First Node.js Application

Installing Node.js and Running Your First Node.js Application

Daily short news for you
  • A short article on how to write blog posts that developers read.

    How to Write Blog Posts that Developers Read

    In summary, get straight to the point and envision the audience you are targeting. Another thing is that the author has over 9 years of writing experience; in the beginning, no one read his work, but persistence helped him reach 300K - 500K readers each year. That's quite an impressive number, isn't it? 🔥

    » Read more
  • Now everything is so modern that people can come up with anything. ferretdb.com is an open-source project that transforms the PostgreSQL database into... MongoDB. That's right, you heard it correctly. If you still want to use Postgres but prefer the Mongo query syntax, then ferretdb is for you.

    Oh, besides PostgreSQL, it can also connect to SQLite. Awesome!!! 🙏

    » Read more
  • Dedicating this to those of you using Cursor. PatrickJS/awesome-cursorrules gathers some .cursorrules files to optimize prompts for Cursor. Imagine these files as the System Prompt for Cursor, controlling it according to your wishes in each project.

    The usage is really simple, just copy the appropriate .cursorrules file and place it in the root folder of the project 🥳

    » Read more

Node.js is an open-source software that is available for free download on the Node.js download page.

Installation

  • For Windows users, click on the Windows Installer
  • For Mac users, click on the macOS Installer
  • For Linux users, you can install it using a package manager

For example, to install Node.js LTS (v12.x) on Ubuntu, you can run the following commands:

curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

Your First Hello World Program

Running a JavaScript application with Node.js is quite simple. Let's create a file called index.js with the following content:

console.log('Hello World');

Save the file and run the following command in the command line:

node index.js

Output:

Hello World
Premium
Hello

Me & the desire to "play with words"

Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

Have you tried writing? And then failed or not satisfied? At 2coffee.dev we have had a hard time with writing. Don't be discouraged, because now we have a way to help you. Click to become a member now!

View all

Subscribe to receive new article notifications

or
* The summary newsletter is sent every 1-2 weeks, cancel anytime.

Comments (1)

Leave a comment...
Avatar
Xuân Hoài Tống1 year ago
Ôi bài viết đã từ hơn 3 năm trước
Reply
Avatar
Xuân Hoài Tống1 year ago
Bài viết thật sơ sài 😅