First attempt would be using an older node version, e.g. by using a node version manager as nvm.
If this doesn’t work anymore, you may want to update your existing Sage 9.x to the latest Sage 9.x branch, which updates to webpack 5 and fix most install and build issues:
Have you upgraded your old Sage 9.x theme to webpack 5 using the latest commit in Sage 9 branch of Sage repository? Have you applied this Theme update approach (previously used for the Sage 9.x update branch (Sage "9.1": Please test))? Updating an existing Sage 9 theme (quick guide) Create a new Sage 9 project with the command above, select the framework that is also used by your own Sage 9 project. (It is assumed that your own Sage project is already under version control (as git). Copy a…