我的WSL2系统在挨饿后开始出现错误。 当我试图操作<代码>npm时。 我收到以下信息:
$ npm
WSL 1 is not supported. Please upgrade to WSL 2 or above.
系统检查:
$ which npm
/mnt/c/Program Files/nodejs/npm
$ /mnt/c/Program Files/nodejs/node.exe
zsh: exec format error: /mnt/c/Program Files/nodejs/node.exe
$ cat /proc/sys/fs/binfmt_misc/WSLInterop
cat: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
$ 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
$ head -n 1 /etc/os-release
PRETTY_NAME="Kali GNU/Linux Rolling"
WSL版本:
PS > wsl -v
WSL版本: 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
https://github.com/kubernetes/minikube/issues/17700#issuecomment-1859073841"rel=“nofollow noreferer”
$ sudo systemctl start wsl-binfmt
System has not been booted with systemd as init system (PID 1). Can t operate.
Failed to connect to bus: Host is down
$ ps -aux | head -2
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2280 1528 hvc0 Sl+ 20:20 0:00 /init
我也试图重新启用WSL2,但是如果成功的话,我不会再说100%,因为我在<代码>wsl -l:
> wsl --terminate kali-linux
The operation completed successfully.
> wsl -l --running
Windows Subsystem for Linux Distributions:
kali-linux (Default)
rancher-desktop
我是否需要转用系统,以固定系统?