I'm having trouble installing nodejs and npm on my newly installed WSL2. I've set the WSL up according to the instructions from Microsoft and downloaded the Ubuntu program from Windows Store. I tried running both sudo apt-get install npm
and sudo apt-get install nodejs
but the answer I get is just "Unable to locate package". I googled a little and found that I could install it via nvm using cURL (curl -v -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
), but cURL manages to set up the TCP connection and then promptly just runs without downloading anything, just running a timer on how long it's been going.
What am I doing wrong? My first thought was that I don't have an internet connection, but it should be running on my Windows connection, and as I say, the TCP is connected correctly because I get no connection errors. Any help on this matter is appreciated!
EDIT: I tried running sudo apt update
and I get connection errors to archive.ubuntu.com and security.ubuntu.com which I presume is the servers it's supposed to download the packages from. I get no other error messages except for the servers not answering and the connection timing out, however I can ping both servers and get an answer very quickly. Forcing it to use IPv4 instead of IPv6 which was suggested on another site did not work either.
EDIT2: This is a corporate computer (which I am admin on) on my private network, but I will look into it to see if there are any specific settings I have to enable to give my Ubuntu terminal access or even if I have to be on the corporate network.