install node in wsl2 code example
Example 1: How to Install WSL2
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
Example 2: install npm in wsl
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
echo 'export NVM_DIR="/home/yourusername/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' > ~/.bashrc
source ~/.nvm/nvm.sh
nvm install node