wsl2 is trying to access node/npm installed on windows. This is because the windows environment variables are accessible through wsl2. You can turn this off by changing appendWindowsPath=False in /etc/wsl.conf .This disables all windows env variable access from wsl2. The downside is that you won't be able to use explorer.exe.
Another way is to use a node virtual environment like nodeenv and install everything inside the environment.
or you could remove the windows node/npm path from wsl2.
PATH=$(REMOVE_PART="/mnt/c/Program Files/nodejs" sh -c 'echo ":$PATH:" | sed "s@:$REMOVE_PART:@:@g;s@^:\(.*\):\$@\1@"')
My nodejs was installed in "/mnt/c/Program Files/nodejs". This will remove nodejs from the wsl path, it should work now. These are some other fixes.