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)

Neon image

Next.js applications: Set up a Neon project in seconds

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Get started →

👋 Kindness is contagious

Dive into this informative piece, backed by our vibrant DEV Community

Whether you’re a novice or a pro, your perspective enriches our collective insight.

A simple “thank you” can lift someone’s spirits—share your gratitude in the comments!

On DEV, the power of shared knowledge paves a smoother path and tightens our community ties. Found value here? A quick thanks to the author makes a big impact.

Okay