Here's how to init your Node.js project with latest Yarn version:
Enable corepack (Node.js >=16.10)
corepack enable
Set the latest versions:
yarn set version berry
Ready to init:
yarn init
If you don't want zero-installs, swap comments in the .gitignore
If you're already in a git project, do
rm -rf .git
Might need to set this for typescript
yarn dlx @yarnpkg/sdks vscode