@sdetweil I don’t see what the problem is.
After upgrading the npm and node to the latest version, I installed the Magic Mirror, and I wonder if that’s the problem.
And I did the npm install python3 and I don’t think this is the cause.
@sdetweil I don’t see what the problem is.
After upgrading the npm and node to the latest version, I installed the Magic Mirror, and I wonder if that’s the problem.
And I did the npm install python3 and I don’t think this is the cause.
pi@raspberrypi:~ $ ls /home/pi/Desktop/Beauty/MagicMirror/config -laF
total 20
drwxr-xr-x 2 pi pi 4096 Apr 15 22:18 ./
drwxr-xr-x 17 pi pi 4096 Apr 15 22:16 …/
-rw-r–r-- 1 pi pi 2960 Apr 15 2019 config.js
-rw-r–r-- 1 pi pi 2623 Apr 15 22:11 config.js.sample
-rw-r–r-- 1 pi pi 13 Apr 15 22:29 .gitignore
/* Magic Mirror Config Sample
*
* By Michael Teeuw http://michaelteeuw.nl
* MIT Licensed.
*
* For more information how you can configurate this file
* See https://github.com/MichMich/MagicMirror#configuration
*
*/
var config = {
address: "0.0.0.0", // Address to listen on, can be:
// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
// - another specific IPv4/6 to listen on a specific interface
// - "", "0.0.0.0", "::" to listen on any interface
// Default, when address config is left out, is "localhost"
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1","172.16.100.133", "::ffff:172.16.100.133", "::1"], // Set [] to allow all IP addresses
// or add a specific IPv4 of 192.168.1.5 :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
language: "en",
timeFormat: 24,
units: "metric",
modules: [
//0
{
module: 'MMM-iFrame',
position: "bottom_center", // This can be any of the regions.
config: {
// See 'Configuration options' for more information.
url: ["https://comic.naver.com/webtoon/weekday.nhn"], // as many URLs you want or you can just ["ENTER IN URL"] if single URL.
updateInterval: 0.5 * 60 * 1000, // rotate URLs every 30 seconds
width: "2000", // width of iframe
height: "1800", // height of iframe
frameWidth: "950", // width of embedded iframe, height is beeing calculated by aspect ratio of iframe
}
},
//1
{
module: "MMM-EmbedYoutube1",
position: "bottom_bar",
config: {
video_id: "w3jLJU7DT5E",
searchlist1: "쯔위",
loop: true
}
},
//2
{
module: "MMM-Modulebar1",
position: "top_left",
classes: "default everyone",
config: {
}
},
//3
{
module: "MMM-Modulebar",
position: "top_left",
classes: "default everyone",
config: {
}
},
{
module: "updatenotification",
position: "top_bar"
},
{
module: "clock",
position: "top_right"
},
{
module: "newsfeed",
position: "bottom_bar",
config: {
feeds: [
{
title: "New York Times",
url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
}
],
showSourceTitle: true,
showPublishDate: true
}
},
{
module: "MMM-Testpython",
disabled: false,
position: "middle",
config:{
}
}
]
};
It’s the same. :(
pi@raspberrypi:~/Desktop/Beauty/MagicMirror $ npm start &
[1] 3066
pi@raspberrypi:~/Desktop/Beauty/MagicMirror $
> magicmirror@2.7.1 start /home/pi/Desktop/Beauty/MagicMirror
> sh run-start.sh
Starting MagicMirror: v2.7.1
Loading config ...
Loading module helpers ...
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: helloworld.
All module helpers loaded.
Starting server on port 8080 ...
Server started ...
Connecting socket for: updatenotification
Sockets connected & modules started ...
Launching application.
/* Magic Mirror Config Sample
*
* By Michael Teeuw http://michaelteeuw.nl
* MIT Licensed.
*
* For more information how you can configurate this file
* See https://github.com/MichMich/MagicMirror#configuration
*
*/
var config = {
address: "0.0.0.0", // Address to listen on, can be:
// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
// - another specific IPv4/6 to listen on a specific interface
// - "", "0.0.0.0", "::" to listen on any interface
// Default, when address config is left out, is "localhost"
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1","172.16.100.133", "::ffff:172.16.100.133", "::1"], // Set [] to allow all IP addresses
// or add a specific IPv4 of 192.168.1.5 :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
language: "en",
timeFormat: 24,
units: "metric",
modules: [
//0
{
module: 'MMM-iFrame',
position: "bottom_center", // This can be any of the regions.
config: {
// See 'Configuration options' for more information.
url: ["https://comic.naver.com/webtoon/weekday.nhn"], // as many URLs you want or you can just ["ENTER IN URL"] if single URL.
updateInterval: 0.5 * 60 * 1000, // rotate URLs every 30 seconds
width: "2000", // width of iframe
height: "1800", // height of iframe
frameWidth: "950", // width of embedded iframe, height is beeing calculated by aspect ratio of iframe
}
},
//1
{
module: "MMM-EmbedYoutube1",
position: "bottom_bar",
config: {
video_id: "w3jLJU7DT5E",
searchlist1: "쯔위",
loop: true
}
},
//2
{
module: "MMM-Modulebar1",
position: "top_left",
classes: "default everyone",
config: {
}
},
//3
{
module: "MMM-Modulebar",
position: "top_left",
classes: "default everyone",
config: {
}
},
{
module: "MMM-Dynamic-Modules",
},
{
module: "alert",
},
{
module: "updatenotification",
position: "top_bar"
},
{
module: "clock",
position: "top_right"
},
{
module: "newsfeed",
position: "bottom_bar",
config: {
feeds: [
{
title: "New York Times",
url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
}
],
showSourceTitle: true,
showPublishDate: true
}
},
{
module: "MMM-Testpython",
disabled: false,
position: "middle",
config:{
}
},
]
};
pi@raspberrypi:~/Desktop/Chanyoung/BeautyMirrorTEST $ rm -rf node_modules
pi@raspberrypi:~/Desktop/Chanyoung/BeautyMirrorTEST $ npm install
npm WARN deprecated time-grunt@2.0.0: Deprecated because Grunt is practically unmaintained. Move on to something better. This package will continue to work with Grunt v1, but it will not receive any updates.
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/danger/vm2@github:patriksimek/vm2#7e82f90ac705fc44fad044147cb0df09b4c79a57" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-04-15T12_43_25_301Z-debug.log
…?
@sdetweil
in terminal, output is
pi@raspberrypi:~/Desktop/MagicMirror $ npm start dev &
[1] 1452
pi@raspberrypi:~/Desktop/MagicMirror $
magicmirror@2.7.1 start /home/pi/Desktop/MagicMirror
sh run-start.sh “dev”
Starting MagicMirror: v2.7.1
Loading config …
Loading module helpers …
Initializing new module helper …
Module helper loaded: updatenotification
No helper found for module: helloworld.
All module helpers loaded.
Starting server on port 8080 …
Server started …
Connecting socket for: updatenotification
Sockets connected & modules started …
Launching application.
after click,That’s all.
There are no errors, and console.log() is not visible from the terminal window.

I transferred what I had done with Mac to the Raspberry pie. I only tried the basic reservation code because the result I wanted was not available. But it didn’t work, either.
It’s good at Mac. Why not at Raspberry Pi?
MMM-TestPython.js
var Testpythons;
Module.register("MMM-Testpython", {
defaults: {},
start: function (){
Testpythons = this;
},
getDom: function() {
var element = document.createElement("div")
element.className = "myContent"
element.id="divid"
element.innerHTML = "Hello, World!!! " + this.config.foo
var subElement = document.createElement("p")
subElement.innerHTML = "Click"
subElement.id = "clickid"
element.appendChild(subElement)
return element
},
notificationReceived: function(notification, payload, sender) {
switch(notification) {
case "DOM_OBJECTS_CREATED":
var elem = document.getElementById("clickid")
elem.addEventListener("click", () => {
Testpythons.sendSocketNotification("TEST")
console.log("hello~hello~hello~hello~hello~hello~hello~hello~hello~hello~")
elem.innerHTML = "click success"
})
break
}
},
socketNotificationReceived: function(notification, payload) {
switch(notification) {
case "I_DID":
console.log("Socket recevied : "+payload)
var elemk = document.getElementById("divid")
elemk.innerHTML = payload
break
}
}
})
node_helper.js
var NodeHelper = require("node_helper");
var socketTestpython;
module.exports = NodeHelper.create({
start: function() {
socketTestpython=this;
},
socketNotificationReceived: function(notification, payload) {
switch(notification) {
case "TEST":
console.log("notification : " + notification)
socketTestpython.sendSocketNotification("I_DID",'hello');
break
}
},
})
npm start dev &


in terminal=>
pi@raspberrypi:~/Desktop/MagicMirror $ npm start dev &
[1] 1452
pi@raspberrypi:~/Desktop/MagicMirror $
magicmirror@2.7.1 start /home/pi/Desktop/MagicMirror
sh run-start.sh “dev”
Starting MagicMirror: v2.7.1
Loading config …
Loading module helpers …
Initializing new module helper …
Module helper loaded: updatenotification
No helper found for module: helloworld.
All module helpers loaded.
Starting server on port 8080 …
Server started …
Connecting socket for: updatenotification
Sockets connected & modules started …
Launching application.
I am working with my friend on a project. When I downloaded what my friend had been working on with my raspberry pie and installed npm start, I got the error:

Friend’s environment is Mac, and I downloaded it to the raspberry pie.
My freiend’s repository is https://github.com/ENTITYSmartMirror/BeautyMirrorTEST
Friend installed and used python-shell module on April 15.
/home/pi/Desktop/BeautyMirrorTEST/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron: 1: /home/pi/Desktop/BeautyMirrorTEST/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron: ���� � 0: not found
/home/pi/Desktop/BeautyMirrorTEST/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron: 4: /home/pi/Desktop/BeautyMirrorTEST/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron: Syntax error: word unexpected (expecting “)”)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! magicmirror@2.6.0 start: sh run-start.sh
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the magicmirror@2.6.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-04-15T06_36_00_871Z-debug.log
{
"name": "MMMTestpython",
"description": "samples",
"version": "0.0.1",
"dependencies": {
"python-shell": "latest"
}
}
Do I have to change it like this and install it again? npm install

@sdetweil oh!!! 
thank you very very very much :)
@sdetweil said in Even a simple node_help.js example does not run.:
console.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload);
var NodeHelper = require("node_helper");
//var {PythonShell} = require('python-shell');
module.exports = NodeHelper.create({
start: function() {},
socketNotificationReceived: function(notification, payload) {
console.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload);
},
})

omg…
Is it normal for these errors to occur?
/modules/MMM-Testpython/package.json
MMM-Testpython
var Testpythons;
Module.register("MMM-Testpython", {
defaults: {},
start: function (){
Testpythons = this;
},
getDom: function() {
var element = document.createElement("div")
element.className = "myContent"
element.id="divid"
element.innerHTML = "Hello, World!!! " + this.config.foo
var subElement = document.createElement("p")
subElement.innerHTML = "Click"
subElement.id = "clickid"
element.appendChild(subElement)
return element
},
notificationReceived: function(notification, payload, sender) {
switch(notification) {
case "DOM_OBJECTS_CREATED":
var elem = document.getElementById("clickid")
elem.addEventListener("click", () => {
Testpythons.sendSocketNotification("TEST")
console.log("hello~hello~hello~hello~hello~hello~hello~hello~hello~hello~")
elem.innerHTML = "click success"
})
break
}
},
})
node_helper.js
var NodeHelper = require("node_helper");
var {PythonShell} = require('python-shell');
module.exports = NodeHelper.create({
start: function() {},
socketNotificationReceived: function(notification, payload) {
switch(notification) {
case "TEST":
console.log("notification : " + notification)
this.sendSocketNotification("I_DID")
break
}
},
})


The notification I_DID in node_helper.js was well communicated and executed. However, the console in node_helper.js is not output…
What is the problem?
var NodeHelper = require("node_helper");
var {PythonShell} = require('python-shell');
module.exports = NodeHelper.create({
start: function() {},
socketNotificationReceived: function(notification, payload) {
Log.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload);
},
})


Even a simple node_help.js example does not run.
var NodeHelper = require("node_helper");
var {PythonShell} = require('python-shell');
module.exports = NodeHelper.create({
start: function() {
console.log("Starting module: " + this.name);
},
socketNotificationReceived: function(notification, payload) {
console.log("Starting module: " + this.name);
switch(notification) {
case "TESTPYTHON":
console.log("notification : " + notification)
this.sendSocketNotification("I_DID")
PythonShell.runString('print("Hello Python")', null, function (err, result) {
if (err) throw err;
console.log(result);
});
break
}
},
})

console doesnt show Starting module…
I tried to use python-shell. So I successfully finished the npm install python-shell.
But I saw it said that to use python-shell, you must use node_helper.js.
So I tried to execute a simple Python code. The notification I_DID in node_helper.js was well communicated and executed. However, the console in node_helper.js is not output, nor is python-shell working.
What is the problem?
var Testpythons;
Module.register("MMM-Testpython", {
defaults: {},
start: function (){
Testpythons = this;
},
getDom: function() {
var element = document.createElement("div")
element.className = "myContent"
element.id="divid"
element.innerHTML = "Hello, World!!! " + this.config.foo
var subElement = document.createElement("p")
subElement.innerHTML = "Click"
subElement.id = "clickid"
element.appendChild(subElement)
return element
},
notificationReceived: function(notification, payload, sender) {
switch(notification) {
case "DOM_OBJECTS_CREATED":
var elem = document.getElementById("clickid")
elem.addEventListener("click", () => {
Testpythons.sendSocketNotification("TESTPYTHON")
console.log("hello~hello~hello~hello~hello~hello~hello~hello~hello~hello~")
elem.innerHTML = "click success"
})
break
}
},
socketNotificationReceived: function(notification, payload) {
switch(notification) {
case "I_DID":
console.log("success")
var elemk = document.getElementById("divid")
elemk.innerHTML = "I_DID"
break
}
},
})
node_helper.js
var NodeHelper = require("node_helper");
var PythonShell = require('python-shell');
module.exports = NodeHelper.create({
start: function() {
console.log("Starting module: " + this.name);
},
socketNotificationReceived: function(notification, payload) {
switch(notification) {
case "TESTPYTHON":
console.log("notification : " + notification)
this.sendSocketNotification("I_DID")
PythonShell.runString('print("Hello Python")', null, function (err, result) {
if (err) throw err;
console.log(result);
});
break
}
},
})