Read the statement by Michael Teeuw here.
electron-rebuild problems with MagicMirror 2.22.0
-
@wishmaster270 OK, you’re welcome.
Since the thread is also for other developers: I recommend considering my approach, as I consider the other approach (installing to a higher-level directory) to be more error-prone. But it’s a creative workaround. -
@KristjanESPERANTO
The problem with installing it in the module directory is that we need to compile the library against the electron version installed in the MagicMirror project.
If electron-rebuild is installed in the module directory it might fail to detect the right electron version (which was the cause of the rebuild problems in the past).
So the right way is to install electron-rebuild in the same project as electron and call it from there.It might be worth to think about adding it as a dependency in the main project.
-
@wishmaster270 Okay, thanks for the explanation! I haven’t been able to read that anywhere in such clear words and I haven’t dealt with the past problems. Then I withdraw my recommendation because I lack the overview.
-
@KristjanESPERANTO ah I see
haven’t heard of @electron/rebuild
-
@wishmaster270 said in electron-rebuild problems with MagicMirror 2.22.0:
So the right way is to install electron-rebuild in the same project as electron and call it from there.
installing module stuff in the
node_modules
folder of mm is a hack and will not work out of the box with a docker setup because this folder is only in the container (you have to map it on the host to get changes there persistent)It might be worth to think about adding it as a dependency in the main project.
in this case may the best solution
-
@karsten13 yes, that’s what I think we come to but doesn’t help any existing broken modules
-
@karsten13 docker is a pita with this stuff. too much/not enough in the container. which is supposed to be immutable.
-
@sdetweil As a soft step, the broken modules could switch to @electron/rebuild. This should also work for docker.
-
I have a docker installation running for development here on my notebook.
Everytime a module needs “npm install” I exec to the container and run the command in the container cause there will be called the correct npm and node version in the container and not the ones I currently use on my notebook.
In this case the directory structure is the same as with a locally installed MagicMirror and the postinstall script will work as excepted. -
@wishmaster270 said in electron-rebuild problems with MagicMirror 2.22.0:
and the postinstall script will work as excepted.
yes, will work, but all the changes in the
node_modules
folder of mm are gone with the next restart of the container …