Install Node.js and npm

Socket.IO runs on Node.js, so you need to install Node.js before creating the application.

Node.js includes npm, which is the package manager used to install project dependencies.

  1. Download and install a supported Node.js LTS release.
  2. Open your terminal or command prompt.
  3. Verify the installation.

The following commands display the installed versions.

Requirements

Runtime

Node.js 20+ recommended

Package Manager

npm

Editor

Visual Studio Code

Browser

Chrome, Firefox, or Edge

Knowledge

Basic JavaScript

Node.js Version

Use an active LTS version of Node.js. Check the requirements of your chosen Socket.IO and other dependency versions before deploying.

Verify Node.js and npm
node --version
npm --version

The first command displays the installed Node.js version. The second command displays the npm version.

Key Takeaways
  • Node.js is required to run the backend.

  • npm manages project dependencies.

  • Verify both installations before proceeding.