Read the statement by Michael Teeuw here.
how to update my MM
-
@sdetweil Maybe combine the script and check if exist then update, else frsh install? Would that work?
-
@rikko14 npm init -y
what is going on…
the instructions say
cd modulename (where modulename is the module having the error) if the module does NOT provide a file called package.json, then do npm init -y
why are you doing this in the users home folder?
-
so i have to do first :
cd ~/MagicMirror/
and afternpm init -y
that’s right ? -
@mumblebaj said in how to update my MM:
Maybe combine the script and check if exist then update, else frsh install? Would that work?
what? check if what exist?
the problem here is that i looped thru all the installed modules, and found a package.json, which now requires a new
npm installin the module folder, BUT, the npm install failed cause of the networking problem
one that is finished, I loop thru all the modules and check to see if they use one of the troublesome libraries
and do NOT reference it in package.json…
and if NO package.json, then I create one, and THEN do the npm install of the libraryphew, all the same as the instructions i gave in the linked topic.
but there might be ANOTHER library too … that I don’t handle…
-
@rikko14 it says
to fix this you need to install the library in the module folder
cd ~/MagicMirror/modules
cd modulename (where modulename is the module having the error)
SO, you have to cd ~/MagicMirror/modules/modulename
same as every other time you were told to cd modulename
-
I’m lost …
here are all the modules I have installed.
I have to do:
cd ~ / MagicMirror / modules / modulename
for each module and thennpm init -y
?
and post here all the results ofnpm init -y
?I have already had this Electron problem several times and I do not remember what I had typed as the command line but it was not that
-
@sdetweil said in how to update my MM:
what? check if what exist?
What I was referring to is for a single script to run, check if MagicMirror exist, check version and upgrade if not on the latest, if not exist then do a fresh install. This way whoever runs your script does not run the wrong one. Just a suggestion.
-
@rikko14 look in the pm2 logs output
search for Cannot find module
sorry for the dual use of the word module. NPM calls the library a module and MagicMirror calls its app a module…
after that string, there will be a name in quotes ‘request’ or ‘valid-url’, or maybe something else
on one of the next lines will be a file path
MagicMirror/modules/??? some MagicMirror module name
THAT is the MagicMirror module which is missing the library found in the 'Cannot find module ’ message above
So, navigate to that MagicMirror module folder
cd ~/MagicMirror/modules/modulename
and then look for the package.json file
ls package.json
if you get ‘No such file or directory’ in response to the ls command, then create the file by doing
npm init -y
next step,
npm install ???
where ??? is the name of the missing library in the message ’ Cannot find module ’done for this library for this MM module
-
@mumblebaj oh… no… don’t want to get into that
they are two distinct functions… users have to learn sometime
-
@sdetweil :-) I understand. But it would make your life easier with running the wrong script, messing up their install and you having to go through a 100 different things for them to do to get it fixed… :-)