Skip to main content
open-telemetry / opentelemetry.io
About Waitlist Learn Search Enterprise
Search
Login Sign Up
Logo
Main Menu Project Homepage Learn Codebase Developer Dashboards Contribute Extensions Help
  • Learn Codebase
  • Learn API
  • Learn SDK
  • Environment Setup
  • Knowledge Base
  • Chat to Codebase
  • Search
Logo Shoulder Homepage
Project Homepage
Learn Codebase
Developer Dashboards
Contribute
Extensions
Help
  • Development
  • Setup
  • Docker Configuration
  • Start & Build
  • Run Tests
  • Configuration
  • Common Issues
  • CI/CD
  • Workflow
  • Automation scripts
  • Deploy
  • Production
  • Deployment
  • Secret Management
  • Monitoring & Logging
  • Scaling & Performance
  • Contributor Dashboards
Cloud Setup Windows Setup MacOS Setup Linux Setup Docker Setup VS Code Setup Terminal

Installing Node.js on Windows

Introduction

Node.js is a powerful JavaScript runtime built on Chrome’s V8 JavaScript engine. It is widely used for building scalable network applications. This guide will walk you through the steps to install Node.js on a Windows machine and explain the differences between the Long Term Support (LTS) and the latest versions of Node.js. Additionally, we’ll cover installing Node.js using the Windows Subsystem for Linux (WSL).

Prerequisites

  • A Windows PC with administrative access.
  • An active internet connection.

Step-by-Step Installation Guide

Step 1: Download Node.js Installer

  1. Open your web browser and go to the official Node.js website: https://nodejs.org/.
  2. You will see two versions available for download:
  • LTS (Long Term Support): Recommended for most users. Ensures stability and extended support.
  • Current: The latest features and updates. Suitable for developers wanting to stay on the cutting edge.
  1. Click on the version you wish to install. For most users, it is recommended to download the LTS version.

Step 2: Run the Installer

  1. Locate the downloaded installer file (usually in your Downloads folder) and double-click it to run.
  2. The Node.js Setup Wizard will open. Follow the prompts:
  • Click Next to proceed through the welcome screen.
  • Read and accept the license agreement, then click Next.
  • Choose the installation path (default is recommended), then click Next.
  • Select the components you want to install. The default settings are recommended. Click Next.
  • Click Install to begin the installation process.

Step 3: Verify Installation

  1. Once the installation is complete, open a Command Prompt window:
  • Press Win + R, type cmd, and hit Enter.
  1. In the Command Prompt window, type the following command to verify Node.js is installed correctly:
node -v
  1. You should see the version number of Node.js displayed.

  2. To verify npm (Node Package Manager) is installed, type:

npm -v
  1. You should see the version number of npm displayed.

Installing Node.js Using Windows Subsystem for Linux (WSL)

What is WSL?

The Windows Subsystem for Linux (WSL) allows you to run a Linux distribution alongside your Windows installation. This can be particularly useful for developers who need a Linux environment to work in while using Windows.

Step 1: Enable WSL

  1. Open PowerShell as Administrator:
  • Press Win + X and select Windows PowerShell (Admin).
  1. Enter the following command to enable WSL:
wsl --install
  1. Restart your computer when prompted.

Step 2: Install a Linux Distribution

  1. Open the Microsoft Store and search for a Linux distribution, such as Ubuntu.
  2. Click Get to download and install the distribution.
  3. Once installed, open the distribution from the Start menu and complete the initial setup.

Step 3: Install Node.js on WSL

  1. Open your WSL terminal (e.g., Ubuntu).
  2. Update your package lists:
sudo apt update
  1. Install Node.js:
  • For the LTS version, use:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
  • For the latest version, use:
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo apt-get install -y nodejs
  1. Verify the installation:
node -v
npm -v

Understanding Node.js Versions: LTS vs. Latest

LTS (Long Term Support)

  • Stability: LTS versions are extensively tested and recommended for most users, especially for production environments.
  • Support: These versions receive critical bug fixes, security updates, and performance improvements for an extended period.
  • Usage: Ideal for users who need a reliable and stable environment. Typically used in enterprise settings where stability is crucial.

Latest (Current)

  • Features: Includes the latest features, updates, and improvements.
  • Updates: Receives more frequent updates and may include breaking changes.
  • Usage: Suitable for developers who want to experiment with new features and stay up-to-date with the latest advancements in Node.js.
  • Risk: May be less stable compared to LTS versions and is not recommended for production use.

Conclusion

Installing Node.js on Windows is a straightforward process, and choosing between the LTS and latest versions depends on your specific needs. The LTS version is ideal for stability and long-term projects, while the latest version is perfect for those who want to leverage the newest features and updates. Using WSL can provide a powerful alternative, allowing you to work within a Linux environment while maintaining your Windows setup.

For further information and documentation, visit the official Node.js documentation.

Troubleshooting

If you encounter any issues during installation or need further assistance, consider the following resources:

  • Node.js FAQ
  • Node.js GitHub Issues
  • WSL Documentation

Installing Node.js on macOS

Introduction

Node.js is a powerful JavaScript runtime built on Chrome’s V8 JavaScript engine. It is widely used for building scalable network applications. This guide will walk you through the steps to install Node.js on a macOS machine and explain the differences between the Long Term Support (LTS) and the latest versions of Node.js.

Prerequisites

  • A Mac computer with administrative access.
  • An active internet connection.

Step-by-Step Installation Guide

Step 1: Download Node.js Installer

  1. Open your web browser and go to the official Node.js website: https://nodejs.org/.
  2. You will see two versions available for download:
  • LTS (Long Term Support): Recommended for most users. Ensures stability and extended support.
  • Current: The latest features and updates. Suitable for developers wanting to stay on the cutting edge.
  1. Click on the version you wish to install. For most users, it is recommended to download the LTS version.

Step 2: Run the Installer

  1. Locate the downloaded installer file (usually in your Downloads folder) and double-click it to run.
  2. The Node.js installer window will open. Follow the prompts:
  • Click Continue to proceed through the welcome screen.
  • Read and accept the license agreement, then click Continue.
  • Choose the installation location (default is recommended), then click Install.
  • Enter your macOS password when prompted and click Install Software.

Step 3: Verify Installation

  1. Once the installation is complete, open a Terminal window:
  • Press Cmd + Space, type Terminal, and hit Enter.
  1. In the Terminal window, type the following command to verify Node.js is installed correctly:
node -v
  1. You should see the version number of Node.js displayed.

  2. To verify npm (Node Package Manager) is installed, type:

npm -v
  1. You should see the version number of npm displayed.

Installing Node.js Using Homebrew

What is Homebrew?

Homebrew is a package manager for macOS that simplifies the installation of software. It is widely used by developers to install and manage software packages.

Step 1: Install Homebrew

  1. Open a Terminal window.
  2. Install Homebrew by running the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Follow the on-screen instructions to complete the installation. You may need to enter your macOS password.

Step 2: Install Node.js with Homebrew

  1. Open a Terminal window.
  2. To install the LTS version of Node.js, run:
brew install node@lts
  1. To install the latest version of Node.js, run:
brew install node
  1. Verify the installation:
node -v
npm -v

Understanding Node.js Versions: LTS vs. Latest

LTS (Long Term Support)

  • Stability: LTS versions are extensively tested and recommended for most users, especially for production environments.
  • Support: These versions receive critical bug fixes, security updates, and performance improvements for an extended period.
  • Usage: Ideal for users who need a reliable and stable environment. Typically used in enterprise settings where stability is crucial.

Latest (Current)

  • Features: Includes the latest features, updates, and improvements.
  • Updates: Receives more frequent updates and may include breaking changes.
  • Usage: Suitable for developers who want to experiment with new features and stay up-to-date with the latest advancements in Node.js.
  • Risk: May be less stable compared to LTS versions and is not recommended for production use.

Conclusion

Installing Node.js on macOS is a straightforward process, and choosing between the LTS and latest versions depends on your specific needs. The LTS version is ideal for stability and long-term projects, while the latest version is perfect for those who want to leverage the newest features and updates. Using Homebrew can provide a streamlined alternative, simplifying the installation and management of Node.js and other software packages.

For further information and documentation, visit the official Node.js documentation.

Troubleshooting

If you encounter any issues during installation or need further assistance, consider the following resources:

  • Node.js FAQ
  • Node.js GitHub Issues
  • Homebrew Documentation

Installing Node.js on Linux

Introduction

Node.js is a powerful JavaScript runtime built on Chrome’s V8 JavaScript engine. It is widely used for building scalable network applications. This guide will walk you through the steps to install Node.js on a Linux machine and explain the differences between the Long Term Support (LTS) and the latest versions of Node.js.

Prerequisites

  • A Linux computer with administrative access.
  • An active internet connection.

Step-by-Step Installation Guide

Method 1: Using NodeSource Repository

Step 1: Add NodeSource Repository

  1. Open a Terminal window.
  2. To add the NodeSource repository for the LTS version, run:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
  1. To add the NodeSource repository for the latest version, run:
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -

Step 2: Install Node.js

  1. Install Node.js by running the following command:
sudo apt-get install -y nodejs

This command works for Debian-based distributions (e.g., Ubuntu). For other distributions, use the equivalent package manager command (e.g., yum for RHEL-based distributions).

Step 3: Verify Installation

  1. Verify that Node.js is installed correctly by running:
node -v
  1. Verify that npm (Node Package Manager) is installed by running:
npm -v

Method 2: Using nvm (Node Version Manager)

Step 1: Install nvm

  1. Open a Terminal window.
  2. Install nvm by running the following command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
  1. Close and reopen the Terminal, or run the following command to load nvm:
source ~/.nvm/nvm.sh

Step 2: Install Node.js with nvm

  1. To install the LTS version of Node.js, run:
nvm install --lts
  1. To install the latest version of Node.js, run:
nvm install node

Step 3: Verify Installation

  1. Verify that Node.js is installed correctly by running:
node -v
  1. Verify that npm (Node Package Manager) is installed by running:
npm -v

Understanding Node.js Versions: LTS vs. Latest

LTS (Long Term Support)

  • Stability: LTS versions are extensively tested and recommended for most users, especially for production environments.
  • Support: These versions receive critical bug fixes, security updates, and performance improvements for an extended period.
  • Usage: Ideal for users who need a reliable and stable environment. Typically used in enterprise settings where stability is crucial.

Latest (Current)

  • Features: Includes the latest features, updates, and improvements.
  • Updates: Receives more frequent updates and may include breaking changes.
  • Usage: Suitable for developers who want to experiment with new features and stay up-to-date with the latest advancements in Node.js.
  • Risk: May be less stable compared to LTS versions and is not recommended for production use.

Conclusion

Installing Node.js on Linux is a straightforward process, and choosing between the LTS and latest versions depends on your specific needs. The LTS version is ideal for stability and long-term projects, while the latest version is perfect for those who want to leverage the newest features and updates. Using nvm provides additional flexibility by allowing you to easily switch between different Node.js versions.

For further information and documentation, visit the official Node.js documentation.

Troubleshooting

If you encounter any issues during installation or need further assistance, consider the following resources:

  • Node.js FAQ
  • Node.js GitHub Issues
  • nvm GitHub Repository

Installing Node.js on Docker

Introduction

Node.js is a powerful JavaScript runtime built on Chrome’s V8 JavaScript engine. It is widely used for building scalable network applications. This guide will walk you through the steps to set up a Node.js environment using Docker, assuming Docker is already installed on your system. Additionally, we will explain the differences between the Long Term Support (LTS) and the latest versions of Node.js.

Prerequisites

  • Docker installed and running on your computer.
  • An active internet connection.

Step-by-Step Installation Guide

Step 1: Choose a Node.js Docker Image

Docker provides official Node.js images that can be used to create containers. These images come in different versions:

  • LTS (Long Term Support): Ensures stability and extended support.
  • Current: The latest features and updates.

Step 2: Pull the Node.js Docker Image

  1. Open a Terminal window.
  2. To pull the LTS version of the Node.js image, run:
docker pull node:lts
  1. To pull the latest version of the Node.js image, run:
docker pull node:latest

Step 3: Create a Docker Container with Node.js

  1. To create and run a Docker container using the pulled Node.js image, run:
docker run -it --name my-node-app -v ${PWD}:/usr/src/app -w /usr/src/app node:lts /bin/bash

Replace node:lts with node:latest if you want to use the latest version.

  • -it runs the container in interactive mode with a terminal.
  • --name my-node-app names the container my-node-app.
  • -v ${PWD}:/usr/src/app mounts the current directory to /usr/src/app in the container.
  • -w /usr/src/app sets the working directory in the container.
  • node:lts specifies the Docker image to use.
  • /bin/bash starts a Bash shell in the container.

Step 4: Verify Installation

  1. Inside the Docker container, verify Node.js is installed correctly by running:
node -v
  1. Verify npm (Node Package Manager) is installed by running:
npm -v

Understanding Node.js Versions: LTS vs. Latest

LTS (Long Term Support)

  • Stability: LTS versions are extensively tested and recommended for most users, especially for production environments.
  • Support: These versions receive critical bug fixes, security updates, and performance improvements for an extended period.
  • Usage: Ideal for users who need a reliable and stable environment. Typically used in enterprise settings where stability is crucial.

Latest (Current)

  • Features: Includes the latest features, updates, and improvements.
  • Updates: Receives more frequent updates and may include breaking changes.
  • Usage: Suitable for developers who want to experiment with new features and stay up-to-date with the latest advancements in Node.js.
  • Risk: May be less stable compared to LTS versions and is not recommended for production use.

Conclusion

Using Docker to set up a Node.js environment is a convenient and efficient method, especially for isolating applications and managing dependencies. Choosing between the LTS and latest versions depends on your specific needs. The LTS version is ideal for stability and long-term projects, while the latest version is perfect for those who want to leverage the newest features and updates.

For further information and documentation, visit the official Node.js documentation and the Docker Hub Node.js repository.

Troubleshooting

If you encounter any issues during setup or need further assistance, consider the following resources:

  • Node.js FAQ
  • Node.js GitHub Issues
  • Docker Documentation
  • Docker Hub Node.js Repository

VS Code Environment

When using VS Code we recommend installing the following extensions:

ESLint

Integrates ESLint JavaScript linter into VS Code.

 screenshot

Docker

Makes it easy to create, manage, and debug containerized applications.

 screenshot

CLI Tooling

The tooling CLI tooling would be beneficial to have setup:

Makefile

NVM

More details coming soon

Cloud based Development Environments

To facilitate a seamless development experience, the project provides various cloud-based development environments and tools. These environments allow you to quickly set up a development workspace without the need for manual configuration or setup. Choose from the following options to get started:

  • Gitpod is available for this project enabling you to start a ready-to-code dev environment in your browser.

Gitpod

Open in Gitpod

GitHub Codespaces

Open in GitHub Codespaces

VS Code

Open in VS Code (Web)
Shoulder.dev can make mistakes.Consider checking important information.