DEV Community

East Bank
East Bank

Posted on

How to install Node.js on WSL ubuntu ?

  1. First of all check your ubuntu version by entering the following command: lsb_release-a

  2. Confirm the compatibility of nodejs according to your ubuntu version: here
    and then enter following command to download the nodejs setup:
    curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh
    for example, if you want to download nodejs 20 replace 23.x by 20.x

  3. Now run the setup by entering the following command:
    sudo -E bash nodesource_setup.sh

  4. Once its done you will see > successfully configured repository
    then enter below command to install the nodejs:
    sudo apt install -y nodejs

  5. Enter node -v to check version and confirm if nodejs is successfully installed.

Top comments (2)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

πŸ‘₯ Ideal for solo developers, teams, and cross-company projects

Learn more