Read the statement by Michael Teeuw here.
Problems with Config.js on Pi4 BlackScreen
-
@dazza120 inside needs to be
cd /home/pi/MagicMirror DISPLAY=:0 npm start
-
@sdetweil changed it what now mate
-
@dazza120 did u try pm2 now?
-
@sdetweil pm2 start or the dev thing?
-
Let’s get npm start dev working
-
@sdetweil still nothing in the dev console mate, i can start the whole build over again but everytime i go to change the config it doesnt work
-
@dazza120 ok, start again… change the config?
So, you install a module. If it has package.json file you run npm install in the module folder
Then edit config.js and add
Module structure.{ module:'somename', config: { } },
To the modules array.
If think syntax error, from the MagicMirror folder do,
npm run config:check
-
@sdetweil yep im cd-ing into the module folder and then running npm install, ill start over again and go through it slowly but ive probably built the mirror 20 from scratch no issues before with config but ive altered it too much now thinking that was it so its from scratch now but copying back the old config should have sorted any of those issues, does your installer work?
-
@sdetweil I think i found the problem mmm-nest-status install messes up the MM install, i think other are having simular things with other modules. i installed MMM-SystemStats changed the config file tested it and it was working find, i installed mmm-nest-status and didn’t alter the config for that so that should have just ment it wouldn’t run that module. i have attached the code below does this shead any light?
pi@raspberrypi:~ $ cd MagicMirror/modules pi@raspberrypi:~/MagicMirror/modules $ git clone https://github.com/BenRoe/MMM-SystemStats Cloning into 'MMM-SystemStats'... remote: Enumerating objects: 22, done. remote: Counting objects: 100% (22/22), done. remote: Compressing objects: 100% (14/14), done. remote: Total 231 (delta 10), reused 16 (delta 8), pack-reused 209 Receiving objects: 100% (231/231), 88.08 KiB | 578.00 KiB/s, done. Resolving deltas: 100% (122/122), done. pi@raspberrypi:~/MagicMirror/modules $ cd MMM-SystemStats pi@raspberrypi:~/MagicMirror/modules/MMM-SystemStats $ npm install npm notice created a lockfile as package-lock.json. You should commit this file. added 1 package from 1 contributor and audited 1 package in 1.265s found 0 vulnerabilities pi@raspberrypi:~/MagicMirror/modules/MMM-SystemStats $ cd pi@raspberrypi:~ $ cd MagicMirror pi@raspberrypi:~/MagicMirror $ npm run config:check > magicmirror@2.8.0 config:check /home/pi/MagicMirror > node tests/configs/check_config.js Checking file... /home/pi/MagicMirror/config/config.js Your configuration file doesn't contain syntax errors :) pi@raspberrypi:~/MagicMirror $ cd modules pi@raspberrypi:~/MagicMirror/modules $ git clone https://github.com/michael5r/mmm-nest-status.git Cloning into 'mmm-nest-status'... remote: Enumerating objects: 135, done. remote: Total 135 (delta 0), reused 0 (delta 0), pack-reused 135 Receiving objects: 100% (135/135), 65.27 KiB | 718.00 KiB/s, done. Resolving deltas: 100% (77/77), done. pi@raspberrypi:~/MagicMirror/modules $ cd mmm-nest-status pi@raspberrypi:~/MagicMirror/modules/mmm-nest-status $ npm install npm WARN deprecated undefined@0.1.0: this package has been deprecated npm WARN saveError ENOENT: no such file or directory, open '/home/pi/MagicMirror/modules/package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open '/home/pi/MagicMirror/modules/package.json' npm WARN modules No description npm WARN modules No repository field. npm WARN modules No README data npm WARN modules No license field. removed 1 package in 1.141s found 0 vulnerabilities pi@raspberrypi:~/MagicMirror/modules/mmm-nest-status $ cd pi@raspberrypi:~ $ pm2 restart MagicMirror Use --update-env to update environment variables [PM2] Applying action restartProcessId on app [MagicMirror](ids: 0) [PM2] [MagicMirror](0) ✓ ┌─────────────┬────┬──────┬────────┬───┬─────┬──────────┐ │ Name │ id │ mode │ status │ ↺ │ cpu │ memory │ ├─────────────┼────┼──────┼────────┼───┼─────┼──────────┤ │ MagicMirror │ 0 │ fork │ online │ 2 │ 0% │ 2.5 MB │ └─────────────┴────┴──────┴────────┴───┴─────┴──────────┘ Use `pm2 show <id|name>` to get more details about an app pi@raspberrypi:~ $ npm run config:check npm ERR! path /home/pi/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2019-07-13T20_08_21_703Z-debug.log pi@raspberrypi:~ $
Complete log from .npm folder
0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'run', 'config:check' ] 2 info using npm@6.10.1 3 info using node@v10.15.2 4 verbose config Skipping project config: /home/pi/.npmrc. (matches userconfig) 5 verbose stack Error: ENOENT: no such file or directory, open '/home/pi/package.json' 6 verbose cwd /home/pi 7 verbose Linux 4.19.57-v7l+ 8 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "config:check" 9 verbose node v10.15.2 10 verbose npm v6.10.1 11 error path /home/pi/package.json 12 error code ENOENT 13 error errno -2 14 error syscall open 15 error enoent ENOENT: no such file or directory, open '/home/pi/package.json' 16 error enoent This is related to npm not being able to find a file. 17 verbose exit [ -2, true ]