Enhancement: Update Script
Closed this issue · 6 comments
Hi Sam,
i used your update script to update to the latest version.
I got a error for a lot of my used modules during "npm install" step in the module folder saying:
processing for module MMM-GPIO-Notifications please wait
----------------------------------
npm ERR! code EJSONPARSE
npm ERR! path /home/pi/MagicMirror/modules/MMM-GPIO-Notifications/package.json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near "...fications/#readme\"\n}\n"
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2023-01-05T19_29_21_152Z-debug-0.log
processing complete for module MMM-GPIO-Notifications
I found an article saying that
npm cache clean --force
may fix the problem. It worked in my case.
It may be worth adding it to the script directly.
hm.. that makes no sense
I'll test w that module..
ok, this is because of this in your package.json
"devDependencies": {},
there is a real problem with npm install --omit=dev
it does ALL the work of checking the dev dependencies even tho you said no, it just doesn't write them out..
but that produces a lot of errors and warnings that don't apply..
so, the only way to prevent it is to remove the devDependencies list, I change the name to devxDependencies, then nm doesn't see it.. .. let me look at the code I JUST added for this problem
my bug, thanks for the issue.. fixed..
try again, with force instead of apply
No need to thank me, thanks for fixing it.
I needed to roll back the update as I do have a additional problem with my GPIO module (electron-rebuild).
I will try your fix tomorrow.
electron-rebuild worked fine today.., ah i see MagicMirror-rebuild worked...
really need to put it in the base and then call it from there..
see how I fixed this
https://github.com/sdetweil/MMM-Buttons
Just tried the fixed upgrader. Now everything works well, no errors (except the electron-rebuild problem).
I already changed to the postinstall.sh of your MMM-Buttons module after our last conversation in the forum but even with your scripts i can not get it running at the moment.