Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.

Node.js is similar in design to, and influenced by, systems like Ruby’s Event Machine and Python’s Twisted. Node.js takes the event model a bit further. It presents an event loop as a runtime construct instead of as a library. In other systems, there is always a blocking call to start the event-loop. Typically, behavior is defined through callbacks at the beginning of a script, and at the end a server is started through a blocking call like EventMachine::run(). In Node.js, there is no such start-the-event-loop call. Node.js simply enters the event loop after executing the input script. Node.js exits the event loop when there are no more callbacks to perform. This behavior is like browser JavaScript — the event loop is hidden from the user.

Install

Download Node.js as Package Manager

  1. Installs NVM (Node Version Manager):

       
          curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
       
    
  2. Download and install Node.js:

       
          nvm install 20
       
    
  3. Verifies the right Node.js version is in the environment:

       
          node -v # should print `v20.12.2`
       
    
  4. Verifies the right NPM version is in the environment:

       
          npm -v # should print `10.5.0`
       
    

Node.js installation web: https://nodejs.org/en/download/package-manager