Since wsl can invoke commands on Windows, I tried to use fnm on wsl.
Follow the instructions and add the following to .bashrc
eval "$(fnm.exe env --use-on-cd)"
Then there was an error
error: Can't infer shell!
fnm can't infer your shell based on the process tree.
Maybe it is unsupported? we support the following shells:
* cmd
* powershell
* bash
* zsh
* fish