I think you need to change the version of Prettier in package.json (this should resolve the error: "Invalid version Error: Invalid version") and downgrade VS Code to get Prettier working. This solution worked for me.
But try downgrading VS Code first. Maybe this will be enough.
I followed this YouTube video to downgrade VS Code to version 1.87: https://www.youtube.com/watch?v=9dhQm-9IbHA
Here are the versions I have in package.json:
on my local machine: