When npm update is run to update packages the build fails. This is because typescript needs to be further updated to 5.1+ The current react scripts version does not allow anything above 5.0. The solution to this might be to switch from Create React App to something else like Vite so that the react-scripts is not used so it doesn't limit the typescript version.
Issues