Home >Web Front-end >JS Tutorial >How to install Node.js on WSL ubuntu ?

How to install Node.js on WSL ubuntu ?

Barbara Streisand
Barbara StreisandOriginal
2024-11-17 18:44:02735browse

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.

The above is the detailed content of How to install Node.js on WSL ubuntu ?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn