Been so long since I ran a default Node-RED install that I completely forgot that it would use my default ~/.node-red settings folder. I've no idea what is in that! Needless to say, it really didn't like it.
I have to say that I don't believe that the dev run should use default config?
npm run dev -- --userDir ./data
Automatically creates the data sub-folder and uses it to create a new config.
But that still fails if you are already running Node-RED on the default port of course!
Unfortunately, Windows cannot set an immediate environment variable like you can on Linux/Mac (e.g. PORT 1990 npm run dev -- --userDir ./data), instead you have to use something like: $env:PORT="3000"; npm run dev -- --userDir ./data; Remove-Item Env:\PORT The chance of remembering that is virtually NIL.
Possible request incoming for something that might fix that issue. I have some code that auto-selects a free port.