Compiling Error: Cannot read properties of null (reading 'useState')

You’re removing yarn.lock but then running npm commands instead of yarn?

FYI this has been reported at [bug] Cannot read properties of null (reading 'useState') · Issue #2581 · roots/bud · GitHub

It seems like this bug might be specifically related to either npm and/or a specific Node version. If you stick with Sage’s defaults, using Yarn and Node v20, then you will not run into this bug.