Effortlessly Install Node.js and npm on WSL2

Here to give you guys a good read, in a different way with each blog. Not a niche-specific blogger. To be honest, I'm just blogging with the aim of applying knowledge to achieve practical goals.
Search for a command to run...

Here to give you guys a good read, in a different way with each blog. Not a niche-specific blogger. To be honest, I'm just blogging with the aim of applying knowledge to achieve practical goals.
No comments yet. Be the first to comment.
Python

Make a Github repo, and push the code to the repo. Login to the server by SSH Check if git is installed or not at the server, if not sudo apt update sudo apt install git Generate an SSH key on the VPS server, To establish a secure con...
If you're trying to install Node.js on your Ubuntu machine, you may have noticed that the version of Node.js you get is not always the latest one available. You might be wondering why that is the case. So why this happens? When you install Node.js on...

Hey there, In the past few days, I have been seeing here everyone is talking about debugging. I like the way Hashnode gives these writing goals which indeed will result in more technical writers. So here I am talking about the Debugging too. But let'...

Hey there, let me tell you something. I was tired of constantly switching between different operating systems on my computer. Windows for photoshop, Linux for coding - it was a never-ending cycle that I just couldn't seem to escape. That's why I deci...

Hey there, if you using Windows Subsystem for Linux (WSL2) and looking to set up Node.js and npm? Here's a simple guide to help you get started:
First things first, let's ensure that we have cURL installed on our system. Run the following command in your Ubuntu terminal:
sudo apt-get install curl
Now, let's install nvm (Node Version Manager) using the following command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
Do keep in mind to replace the v0.38.0 in the path with the latest version available. Updating to a newer version of nvm will automatically replace the older one.
Once that's done, let's restart the terminal to apply the changes.
To verify the installation, run the following command:
command -v nvm
If all goes well, you should see nvm as the output.
Now, it's time to install Node.js. You have two options to choose from:
nvm install --lts
nvm install node
Finally, let's verify the installation by running the following commands:
node --version #node.js
npm --version #npm
And that's it! You should now have Node.js and npm installed on your WSL2 system. Feel free to comment with any queries.