Table of Content:

    Share this post:

    How to Install Node.js on Windows, Ubuntu, and macOS

    Learn about Installing Node.js on Windows, Ubuntu, and macOS. Discover more about the step-by-step process for each platform to harness the power of Javascript for building scalable server-side applications. Happy coding!

    How to Install Node.js on Windows, Ubuntu, and macOS

    Node.js is a powerful and popular open-source JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to run JavaScript code on the server-side, enabling them to create scalable and high-performance applications. Installing Node.js on different operating systems like Windows, Ubuntu, and macOS is a straightforward process, and this article will guide you through the steps for each platform.

    Installing Node.js on Windows

    Step 1: Download Node.js

    To get started with installing Node.js on Windows, visit the official Node.js website (https://nodejs.org) and download the Windows installer (msi). Node.js offers two versions: the LTS (Long Term Support) version and the Current version. The LTS version is recommended for most users as it provides stable features and security updates over an extended period.

    Step 2: Run the Installer

    Once the download is complete, locate the downloaded msi file and double-click to run the installer. The Node.js installation wizard will guide you through the process.

    Step 3: Accept License Agreement

    The installer will display the Node.js End User License Agreement. Read the terms and conditions, and if you agree, click on the "Next" button to proceed.

    Step 4: Choose Installation Location

    The next step allows you to choose the destination folder for Node.js installation. The default location is usually preferred, but you can change it if needed. Click on "Next" to continue.

    Step 5: Select Components

    The installer will prompt you to select the components you want to install. In most cases, the default selection is sufficient. However, you can also include or exclude specific components as per your requirements. Once done, click on "Next."

    Step 6: Start Installation

    After configuring the components, click on the "Install" button to start the installation process. The installer will set up Node.js on your Windows system.

    Step 7: Verify Installation

    To verify that Node.js has been installed successfully, open the Command Prompt or PowerShell and type the following command:

          node -v
    
        

    This command will display the installed Node.js version if the installation was successful.

    Join our community of NodeJS learners.

    JOIN NOW

    Learn NodeJS

    Installing Node.js on Ubuntu

    Step 1: Update Package Lists

    Before installing Node.js on Ubuntu, it's crucial to ensure that you have the latest package information from the repositories. Open a terminal and execute the following command:

          sudo apt update
        

    The sudo apt update command updates the list of available packages from the Ubuntu repositories.

    Step 2: Install Node.js

    With the package lists updated, you can now proceed to install Node.js using the apt package manager. This command installs Node.js on your Ubuntu system along with its dependencies.

          sudo apt install nodejs
    
        

    Step 3: Verify Installation

    After the installation is complete, you can verify whether Node.js has been successfully installed by checking its version. In the terminal, type the following command:

          node -v
    
        

    This will display the installed version of Node.js. Additionally, you can check the installed npm (Node Package Manager) version with:

          npm -v
    
        

    If both commands return the version numbers, congratulations! You have successfully installed Node.js on your Ubuntu machine.

    If both commands display the versions, congratulations! You have successfully installed Node.js on Ubuntu.

    Become an expert in NodeJS today.

    Learn NodeJS with our certified teachers and attend live classes to become an expert in no time.

    START NOW

    Installing Node.js on macOS

    Step 1: Use Homebrew (recommended)

    Homebrew is a popular package manager for macOS that simplifies the installation of various software packages, including Node.js. If you don't have Homebrew installed, open Terminal and run the following command to install it:

          /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
        

    Step 2: Install Node.js

    Once you have Homebrew installed, you can proceed with installing Node.js by running the following command in Terminal:

    This command will download and install the latest version of Node.js on your macOS system.

          brew install node
    
        

    Step 3: Verify Installation

    To ensure that Node.js has been successfully installed on your macOS, open Terminal and type the following command:

          node -v
    npm -v
    
        

    Press Enter. If the installed version of Node.js is displayed, you have successfully installed Node.js on macOS.

    Conclusion

    Installing Node.js on Windows, Ubuntu, and macOS is a relatively simple process if you follow the steps outlined in this article. Node.js is a versatile and powerful platform that empowers developers to build robust applications using JavaScript. Whether you are on Windows, Ubuntu, or macOS, by following these installation guides, you can start developing with Node.js and take advantage of its vast ecosystem of libraries and tools. Happy coding!

    Register now and learn NodeJS with a teacher!

    START NOW