I managed to get rind of this error and get the project adding msql, by installing version 7.3.5 of the mssql package.
npm install [email protected]
I have yet to actually try any of the mssql functions, but now I can require the mssql and not have the project crash.
const sql = require("mssql");
With other versions of mssql I got the errors and could not try anything with the SQL server connection. I am still not sure why I get the errors with later versions of mssql which should be compatible with the version of nodejs I am susing, all I can think is that some of the other packages perhaps interfered with finding the module 'node:events'.