Read the statement by Michael Teeuw here.
cannot find module
-
Everything worked fine and I don’t think I did anything. Then I get the error below.
pm2 status node:internal/modules/cjs/loader:1024 throw err; ^ Error: Cannot find module './ranges/ltr' Require stack: - /usr/lib/node_modules/pm2/node_modules/semver/index.js - /usr/lib/node_modules/pm2/lib/Common.js - /usr/lib/node_modules/pm2/lib/Client.js - /usr/lib/node_modules/pm2/lib/API.js - /usr/lib/node_modules/pm2/lib/binaries/CLI.js - /usr/lib/node_modules/pm2/bin/pm2 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1021:15) at Function.Module._load (node:internal/modules/cjs/loader:866:27) at Module.require (node:internal/modules/cjs/loader:1093:19) at require (node:internal/modules/cjs/helpers:108:18) at Object.<anonymous> (/usr/lib/node_modules/pm2/node_modules/semver/index.js:39:13) at Module._compile (node:internal/modules/cjs/loader:1191:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10) at Module.load (node:internal/modules/cjs/loader:1069:32) at Function.Module._load (node:internal/modules/cjs/loader:904:12) at Module.require (node:internal/modules/cjs/loader:1093:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/usr/lib/node_modules/pm2/node_modules/semver/index.js', '/usr/lib/node_modules/pm2/lib/Common.js', '/usr/lib/node_modules/pm2/lib/Client.js', '/usr/lib/node_modules/pm2/lib/API.js', '/usr/lib/node_modules/pm2/lib/binaries/CLI.js', '/usr/lib/node_modules/pm2/bin/pm2' ] }
I appreciate any help getting this sorted.
-
@theaddies what happened right before the error?
did u upgrade node or npm?
did you have a power failure? -
@sdetweil My girfriends daughter pulls the plug on it. So yea, a power failure.
-
@theaddies ouch…
‘maybe’ this will work, but most of the time I have to replace the sd card
try
sudo npm uninstall pm2 -g
I would reboot here
then use my script to add it back
see https://github.com/sdetweil/MagicMirror_scriptsthe fixuppm2 command at the bottom of the page
even if it works, I would plan to get off that sd card asap
use my backup/restore scripts to backup the MM info
https://github.com/sdetweil/MagicMirror-backup-restoreI am testing a new release,
select the withfiles dropdown before copy/pasting the backup command -
Does duplicating the card duplicate the flaw or is the copy good? Or is there a way I can make a copy of the important parts of the OS without duplicating the card?
-
@theaddies copying the card copies the troubles
only way is to start over.
use my backup script to save your mm config and modules list for reinstall on restore
use my install script to I shall mm after a new SD card is made and booted
then run restore
it’s the fastest way, least amount of work
-
@sdetweil Thanks for the reply. I started over. I just made a posts where I ran your script and can’t get it to work. I don’t know how I ever got this thing working in the first place. I have 3 of them running and now I can’t anything to go. My other post is awaiting approval.
-
@theaddies I don’t see any pending posts
-
@theaddies script is copy paste the line from GitHub to terminal window, and hit enter
show me the ~/install.log
-
@theaddies which script? install or backup?