Read the statement by Michael Teeuw here.
electron-rebuild and MagicMirror v2.18 (and more)
-
@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-rebuildINSIDE 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-Sensormodule (for example):
cd MMM-PIR-Sensor- after install
magicmirror-rebuild
npm i magicmirror-rebuild- execute
MagicMirror-rebuildprogram
./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)
-
@bugsounet
That did the trick. How can I thank you. It is working like it should!! -
-
@bugsounet I followed your instructions but the rebuilding step failed with the following message:
MagicMirror Building module: epoll, Completed: 0gyp: name ‘openssl_fips’ is not defined while evaluating condition ‘openssl_fips != “”’ in binding.gyp while trying to load binding.gyp
✖ MagicMirror Rebuild FailedAn unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild ‘/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll’.
Error:gypfailed with exit code: 1Error: node-gyp failed to rebuild ‘/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/epoll’.
Error:gypfailed with exit code: 1at ModuleRebuilder.rebuildNodeGypModule (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/magicmirror-rebuild/build/module-rebuilder.js:193:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Rebuilder.rebuildModuleAt (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/magicmirror-rebuild/build/rebuild.js:180:9)
at async Rebuilder.rebuild (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/magicmirror-rebuild/build/rebuild.js:143:17)
at async /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/magicmirror-rebuild/build/cli.js:141:9Do you know what the problem is? Thanks!
-
@susl :
- Recommended version of npm: v6.14.15
- Recommended version of node: v14.x.x or v16.x.x
to verify, try this in a terminal (or ssh):
node -v npm -v -
@bugsounet
node version: v17.3.0
npm version: 8.3.0So obviously not the correct version :-( Do you know how I can change the versions?
-
@susl you can use n to install or select different versions of node (and npm)
to install n
sudo npm install n -g
then to install or use a version of node
n 16to switch
n
the select from the list
-
@sdetweil
Thanks a lot. I works now! -
@bugsounet Thank you for this!! It works like a charm ;)
-
Wow, perfect ! Thank you so much !
-
Thanks for doing this - much appreciated!
-
@michael5r with pleasure ;l
-
Hi @bugsounet
Same problem after update to 2.19 :(During the update, i needed to force because a log say the package-lock.json has been modified. Maybe my error.
Trying to reproduce the procedure, but
pi@MagicMirror:~/MagicMirror/modules/MMM-PIR-Sensor $ ./node_modules/.bin/MagicMirror-rebuild ⠋ Searching dependency tree An unhandled error occurred inside electron-rebuild Could not detect abi for version 17.2.0 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron Error: Could not detect abi for version 17.2.0 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron at Object.getAbi (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/node-abi/index.js:39:9) at new Rebuilder (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/magicmirror-rebuild/build/rebuild.js:100:48) at rebuildWithOptions (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/magicmirror-rebuild/build/rebuild.js:249:23) at doRebuild (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/magicmirror-rebuild/build/rebuild.js:272:16) at /home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/magicmirror-rebuild/build/cli.js:115:45 pi@MagicMirror:~/MagicMirror/modules/MMM-PIR-Sensor $Did you know how to solve this ?
-
MMM-PIR-Sensor state is :
This repository has been archived by the owner. It is now read-only.I will not doing a patch on every update for this @paviro module
Just use another maintened pir module
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login