Node.js on WSL

The apt-get version of node is incredibly old, and simplest way to install latest binary distributions:

curl -sL | sudo -E bash -
sudo apt-get install -y nodejs

Yarn Package Manager

curl -sL | sudo apt-key add -
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn

Reclaim WSL Disk Space

I occasionally have workloads that consume large amounts of disk space for temporary use. When I’m done with that workload, I have to:

wsl --shutdown
optimize-vhd -Path .\ext4.vhdx -Mode full

Better is to use “online” tool okibcn/wslcompact compacts the size of the WSL images by removing unused space. Try running wslcompact without parameters just for info on WSL images.

Bez instalacije bucketa, možeš da instaliraš samo tool:

scoop install
date 14. May 2019 | modified 10. Jun 2024
filename: Windows » WSL