Read the statement by Michael Teeuw here.
electron-rebuild and MagicMirror v2.18 (and more)
-
@bugsounet Thanks for this lib. Integrated it into two of my modules yesterday because I couldn’t get them compiled with electron-rebuild.
-
If it can help, it’s perfect ;)
I have do the same too for rebuild modulesbut don’t forget to delete
"electron-rebuild": "v.xxx",
from for package.json file ;)
because this old package is not needed now -
@hedmik : i just share (one of) my own library ;)
-
@bugsounet thank you very much, for weeks I am looking for a solution to finally be able to add an essential function to the mirror :thumbs_up:
-
@bugsounet THANK YOU! This saved me a lot of headaches. I went ahead and updated to 2.18 and got the exact error you reference in the exact same module. A quick search and I found your very helpful solution. Thank you for sharing.
-
I get an error when " ~/node_modules $ ~/.bin/MagicMirror-rebuild"
error=(an unhandled error occurred inside electron-rebuild)
unable to find electron’s version number of MagicMirror etc -
@lhops
Can or has anyone written code for an new MMM-PIR-Sensor module that will work will the new version of MagicMirror. If not is that something that your can do? I wish I knew more about the code I would do it myself. -
@lhops said in electron-rebuild and MagicMirror v2.18 (and more):
I get an error when " ~/node_modules $ ~/.bin/MagicMirror-rebuild"
execute
./node_modules/.bin/MagicMirror-rebuild
INSIDE the module directory ;)not inside other directory ;)
Note :- every module in MagicMirror is there:
cd ~/MagicMirror/modules
- After change again the directory to your wanted module,
forMMM-PIR-Sensor
module (for example):
cd MMM-PIR-Sensor
- after install
magicmirror-rebuild
npm i magicmirror-rebuild
- execute
MagicMirror-rebuild
program
./node_modules/.bin/MagicMirror-rebuild
-
you will see
MagicMirror Rebuild Complete
-
it’s done ;)
-
@bugsounet
This is the results of the instructions:pi@raspberrypi:~/MagicMirror/modules/MMM-PIR-Sensor $ npm i magicmirror-rebuild
npm ERR! code EJSONPARSE
npm ERR! path /home/pi/MagicMirror/modules/MMM-PIR-Sensor/package.json
npm ERR! JSON.parse Unexpected string in JSON at position 803 while parsing ‘{
npm ERR! JSON.parse “name”: "Magic-Mirror-Module-PIR-Sen’
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/2022-01-10T14_40_47_069Z-debug-0.logI am sure you can look at this and see my problem.
Thank you for all your help! -
@lhops said in electron-rebuild and MagicMirror v2.18 (and more):
npm ERR! JSON.parse “name”: "Magic-Mirror-Module-PIR-Sen’
If you have modified the “package.json” file … and you do not respect the syntax.
here is the result ;)
(Info: it is not like this that we rename a module)to correct your issue try this:
cd ~/MagicMirror/modules/MMM-PIR-Sensor rm -rf node_modules package-lock.json git reset --hard HEAD npm install magicmirror-rebuild --save npm remove electron-rebuild npm install
(Sometime, i’m very kind… So kind for me)