Read the statement by Michael Teeuw here.
MMM-PIR-Sensor - White Screen
-
Similar problem to @Them-Russians when running npm install. Then after starting MM using pm2 I get a white screen. Checking the pm2 error logs I see the following error with a module version mismatch: “Expected 50, got 49”.
0|mm | App threw an error during load 0|mm | Error: Module version mismatch. Expected 50, got 49. 0|mm | at Error (native) 0|mm | at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20) 0|mm | at Object.Module._extensions..node (module.js:583:18) 0|mm | at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20) 0|mm | at Module.load (module.js:473:32) 0|mm | at tryModuleLoad (module.js:432:12) 0|mm | at Function.Module._load (module.js:424:3) 0|mm | at Module.require (module.js:483:17) 0|mm | at require (internal/module.js:20:19) 0|mm | at bindings (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/bindings/bindings.js:76:44)
Tried @James solution using npm rebuild but changed the version parameter to 50. Still no luck.
npm rebuild --runtime=electron --target=1.3.4 --disturl=https://atom.io/download/atom-shell --abi=50
Any help would be much appreciated before I reformat my sd card and start from scratch.
-
@bungee09
npm list
and look for electron to find the right version. Then rerun the rebuild command with replaced version number -
@yawns
Works a treat. Thanks! -
@bungee09 Did you get the
npm install
to work on the “MMM-PIR-Sensor” directory? Or did you just run thenpm list
to get the version of electron and then runnpm rebuild --runtime=electron --target=1.3.4 --disturl=https://atom.io/download/atom-shell --abi=50
with the right version?Which directory were you in when you ran the rebuild?
Sorry - i’m at work now, so dont have the Pi with me, but have been having issues with this for a week now, so i’m really hoping that this works for me :)
-
@Them-Russians - I feel your frustration! I spent a good few hours debugging this after installing and testing my PIR sensor. This is what eventually worked for me:
I ran all the commands in the MMM-PIR-Sensor Directory.
cd ~/MagicMirror/modules/MMM-PIR-Sensor npm list
I found the electron version number to be “1.4.3” so updated target to 1.4.3. Also, updated abi to 50 in the following command as this was the expected value from the error message in pm2 logs.
npm rebuild --runtime=electron --target=1.4.3 --disturl=https://atom.io/download/atom-shell --abi=50
As soon as the rebuild was complete…
cd pm2 restart mm
… to restart MagicMirror in pm2.
I also found this link which described the same fix.
Good luck!
-
@bungee09 Did your rebuild work successfuly? I got an error saying that i needed to have the latest versions of node.js and npm installed.
I believe I have node version 6.9.4. Is that what you were using?
After all this, i thought maybe i jacked up something, so i cleared out and reformatted the micro SD card. I reinstalled NOOBS and then got the Magic Mirror. Created the config.js file and ran the mirror without issue. Immediately after that, i cloned the PIR module and tried to run an “npm install” which failed, and so did the rebuild :(
-
@Them-Russians The rebuild was successful for me using exactly the method I described above. I don’t have my pi with me currently but I only installed node for the first time last week so I definitely don’t have an old version. I can check the exact version number when I get home for you.
-
@Them-Russians
BTW? Did you install node in the main MagicMirror directory first before installing dependencies in the MMM-PIR-Sensor directory?cd ~/MagicMirror npm install
-
@bungee09 I did not do that install in the Magic Mirror folder. I ran the “curl” command from the github site for the MagicMirror, set up config.js, and then immediately got the PIR module.
Do you think i could run the npm install on the MagicMirror folder now, and try again with the rebuild, or would i have to clear my SD card and reinstall everything and start from scratch?
-
@Them-Russians said in MMM-PIR-Sensor - White Screen:
@bungee09 I did not do that install in the Magic Mirror folder. I ran the “curl” command from the github site for the MagicMirror, set up config.js, and then immediately got the PIR module.
Do you think i could run the npm install on the MagicMirror folder now, and try again with the rebuild, or would i have to clear my SD card and reinstall everything and start from scratch?
Yes, running npm install now will work and it is required.