mboskamp / MMM-PIR

This MagicMirror module monitors a PIR sensor and turns on/off your display. You can even run custom scripts and control it via Telegram.
16 stars 6 forks source link

Can't launch #12

Closed k-0 closed 4 years ago

k-0 commented 5 years ago

The Screen is black and i only see my mouse...

I got following error: ^[[31mWARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: ReferenceError: NodeHelper is not defined^[[39m ^[[31m at Object. (/home/pi/MagicMirror/modules/MMM-PIR/node_helper.js:11:18)^[[39m ^[[31m at Object. (/home/pi/MagicMirror/modules/MMM-PIR/node_helper.js:67:3)^[[39m ^[[31m at Module._compile (internal/modules/cjs/loader.js:711:30)^[[39m ^[[31m at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)^[[39m ^[[31m at Module.load (internal/modules/cjs/loader.js:620:32)^[[39m ^[[31m at tryModuleLoad (internal/modules/cjs/loader.js:559:12)^[[39m ^[[31m at Function.Module._load (internal/modules/cjs/loader.js:551:3)^[[39m ^[[31m at Module.require (internal/modules/cjs/loader.js:658:17)^[[39m ^[[31m at require (internal/modules/cjs/helpers.js:20:18)^[[39m ^[[31m at loadModule (/home/pi/MagicMirror/js/app.js:126:17)^[[39m App threw an error during load ReferenceError: NodeHelper is not defined at Object. (/home/pi/MagicMirror/modules/MMM-PIR/node_helper.js:11:18) at Object. (/home/pi/MagicMirror/modules/MMM-PIR/node_helper.js:67:3) at Module._compile (internal/modules/cjs/loader.js:711:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:559:12) at Function.Module._load (internal/modules/cjs/loader.js:551:3) at Module.require (internal/modules/cjs/loader.js:658:17) at require (internal/modules/cjs/helpers.js:20:18) at loadModule (/home/pi/MagicMirror/js/app.js:126:17) ReferenceError: NodeHelper is not defined at Object. (/home/pi/MagicMirror/modules/MMM-PIR/node_helper.js:11:18) at Object. (/home/pi/MagicMirror/modules/MMM-PIR/node_helper.js:67:3) at Module._compile (internal/modules/cjs/loader.js:711:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:559:12) at Function.Module._load (internal/modules/cjs/loader.js:551:3) at Module.require (internal/modules/cjs/loader.js:658:17) at require (internal/modules/cjs/helpers.js:20:18) at loadModule (/home/pi/MagicMirror/js/app.js:126:17)

lxne commented 5 years ago

Hi, I get exactly the same error. Any ideas out there how to solve it?

Tried to change the tvservice command for on and off to vcgencmd display_power 0 and 1 (because the tvservice command won't work with my setup) but that didn't help.

Sidenote: I do have almost the same problem with MMM-PIR-Sensor module. Only the log looks a bit different: ^[[31mWARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'onoff'^[[39m App threw an error during load Error: Cannot find module 'onoff' at Module._resolveFilename (internal/modules/cjs/loader.js:602:15) at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12) at Function.Module._load (internal/modules/cjs/loader.js:528:25) at Module.require (internal/modules/cjs/loader.js:658:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:11:14) at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:148:3) at Module._compile (internal/modules/cjs/loader.js:711:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10) at Module.load (internal/modules/cjs/loader.js:620:32) { Error: Cannot find module 'onoff' at Module._resolveFilename (internal/modules/cjs/loader.js:602:15) at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12) at Function.Module._load (internal/modules/cjs/loader.js:528:25) at Module.require (internal/modules/cjs/loader.js:658:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:11:14) at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:148:3) at Module._compile (internal/modules/cjs/loader.js:711:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10) at Module.load (internal/modules/cjs/loader.js:620:32) code: 'MODULE_NOT_FOUND' }

lxne commented 4 years ago

Got mine working. See #10

kjendal commented 4 years ago

node_helper.js is missing var NodeHelper = require("node_helper");

see kjendal/MMM-PIR

AceTheFace commented 4 years ago

Thanks @kjendal. Your fix worked for me!