Read the statement by Michael Teeuw here.
electron-rebuild problems with MagicMirror 2.22.0
-
@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_modulesfolder of mm are gone with the next restart of the container … -
@karsten13
In case of electron-rebuild this is no problem as it is only required during compile but not at runtime. -
o.k., but where are the compile results stored?
-
@karsten13
They are stored in thenode_modulesfolder of the module which should be persistentEdit: Do not misunderstand me. In my opinion the best way to solve the electron-rebuild problems of a lot of modules would be to put “@electron/rebuild” as a dependency to “package.json” of MagicMirror.
-
@wishmaster270 said in electron-rebuild problems with MagicMirror 2.22.0:
@karsten13
They are stored in thenode_modulesfolder of the module which should be persistentthats good, so the construction with installing
electron-rebuildin mm folder has no side effects and works also in a docker setup. -
@wishmaster270 said in electron-rebuild problems with MagicMirror 2.22.0:
Edit: Do not misunderstand me. In my opinion the best way to solve the electron-rebuild problems of a lot of modules would be to put “@electron/rebuild” as a dependency to “package.json” of MagicMirror.
I don’t have a final opinion on that yet, but if so, we should put it under
optionalDependenciesaselectron -
You are right. I think
optionalDependencieswould be a great solution. Module developers could then add a hint to runnpm ciin the MagicMirror directory to their installations instructions.As the container it self is untouched it should be no problem. It only causes @electron/rebuild to be installed the next time the script is called.
-
@KristjanESPERANTO but if u look at electron/rebuild after install u call electron-rebuild
still has to be installed in the base node_modules folder…
older unmaintained modules are broken either way. why I had to fork MMM-Buttons.
-
@wishmaster270 optional is there so that IF electron is NOT installed, the install does not fail (needed on pi0w at least)
have nothing to do w cimy script ONLY installs prod, no dev. as 99.5% of users are users not mm developers. has nothing to do w module developers
-
@karsten13 and the postinstall checks for it being there, and if so skips the e-r install.
doesn’t know/care HOW it got installed before
-
you can use
--omit=optionalas param fornpm install, I use this for myamd64images because they are run to 99,9% withnpm run serverso electron is not needed -
@karsten13 What are your thoughts on adding
npm install @electron/rebuild --unsafe-perm; \as part of the container image creation process to https://gitlab.com/khassel/magicmirror/-/blob/master/build/Dockerfile-debian? -
I’m trying to keep image size small … but which image are you using?
latestorfat?
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