When I try to run npm
command under WSL2, I get this message:
$ npm
WSL 1 is not supported. Please upgrade to WSL 2 or above.
But I'm pretty sure it's running under WSL2: System inspection:
$ cat /proc/version
Linux version 5.15.146.1-microsoft-standard-WSL2 (root@65c757a075e2) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Thu Jan 11 04:09:03 UTC 2024
WSL version:
PS > wsl -v
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3447
Seems like this is https://github.com/kubernetes/minikube/issues/18484 issue.
For some reason, my wsl was not being restarted by wsl --terminate
command. I had to use:
> wsl --shutdown
> wsl -l --running
Windows Subsystem for Linux Distributions:
kali-linux (Default)
# nope, still running: few more shots:
> wsl --shutdown
> wsl --shutdown
> wsl -l --running
There are no running distributions.
# Now I cat start wsl2 again:
> wsl --install kali-linux
Kali Linux Rolling is already installed.
Launching Kali Linux Rolling...
Now my npm
command works again with WSL2. I have to do this procedure every time after starting minikube