MagicMirror won't start after update: npm run start issue

Hey folks, I’m in a bit of a pickle with my MagicMirror setup. I recently updated it, and now it’s refusing to run. I thought maybe updating node to the latest version would fix it, but no luck there either.

When I try to start it, I get a bunch of error messages. It looks like there’s some issue with the electron module not being found. Here’s a snippet of what I’m seeing:

sh: 1: ./node_modules/.bin/electron: not found

npm ERR! Linux 6.12.20+rpt-rpi-2712
npm ERR! argv "/usr/local/bin/node" "/home/user/node_modules/.bin/npm" "run" "start:x11"
npm ERR! node v22.12.0
npm ERR! npm  v2.15.12
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

Any ideas on how to get this working again? I’m pretty stumped and could really use some help. Thanks in advance!

Have you considered checking your npm permissions? Sometimes, these issues can arise from insufficient permissions when trying to install or update packages. Try running the npm commands with sudo, like ‘sudo npm run start’. If that works, you might need to adjust your npm configuration or directory permissions.

Another thing to look at is your package.json file. Make sure all the dependencies are correctly listed and that there are no conflicts. You could also try running ‘npm audit fix’ to address any potential security vulnerabilities that might be causing issues.

If none of that works, you might want to consider using a node version manager like nvm. This allows you to easily switch between node versions, which can be helpful in troubleshooting these kinds of problems. Just a thought based on my experience with similar situations.

hey alexlee, sucks ur having issues! sounds like a dependency prob. have u tried deleting the node_modules folder and running npm install again? that usually fixes weird npm errors for me. if not, maybe try downgrading node to an older version? good luck!

I’ve encountered similar issues after updates before. One thing that’s worked for me is completely removing and reinstalling the MagicMirror software. It’s a bit drastic, but it ensures you have a clean slate.

First, backup your config files and custom modules. Then, remove the MagicMirror directory entirely. Clone a fresh copy from the GitHub repo, and run the installation process again. This should pull in all the correct dependencies for your system.

If you’re still having trouble after that, it might be worth checking your global npm setup. Sometimes conflicting global packages can cause weird errors. You could try clearing your npm cache with ‘npm cache clean --force’ and then reinstalling.

Hope this helps you get back up and running!