It may be the downgrade or a bug in the post install script for my module. Backstory: My module tries to install a patch to the main electron.js file on older MM versions so it can safely close the streams when you shut down the mirror - this is now included in the core MM code and is not installed if the code already exists.
The errors with npm upgrade: it should be sudo
before that line, that’s why you have a bunch of permission errore, but the node update took care of the npm update too.
To fix the mirror install, replace MagicMirror/js/electron.js
with a fresh copy from github for your version of MM to undo whatever the patch broke when it failed.