发现错误:错误:找不到模块'node_helper'

时间:2019-10-18 05:21:37

标签: raspberry-pi3 raspbian magic-mirror

我在魔术镜上安装了Google助手,安装了MMM-Hotword和MMM-Assistant2,甚至进行了npm重建,但是当我运行npm start时,它显示找不到node_helper。

启动MagicMirror:v2.9.0 正在加载配置... 加载模块助手... 找不到模块帮助:警报。

警告!无法加载配置文件。从默认配置开始。发现错误:错误:找不到模块'node_helper'

正在加载模块助手... 找不到模块帮助器:警报。 应用在加载期间引发错误 错误:找不到模块“ node_helper”     在Module._resolveFilename(internal / modules / cjs / loader.js:602:15)     在Function.Module._resolveFilename(/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)     在Function.Module._load(内部/模块/cjs/loader.js:528:25)     在Module.require(internal / modules / cjs / loader.js:658:17)     在要求时(内部/模块/cjs/helpers.js:20:18)     在对象。 (/home/pi/MagicMirror/modules/default/updatenotification/node_helper.js:6:18)     在对象。 (/home/pi/MagicMirror/modules/default/updatenotification/node_helper.js:100:3)     在Module._compile(内部/模块/cjs/loader.js:711:30)     在Object.Module._extensions..js(内部/模块/cjs/loader.js:722:10)     在Module.load(internal / modules / cjs / loader.js:620:32) 哎呀!有一个未捕获的异常。 {错误:找不到模块'node_helper'     在Module._resolveFilename(internal / modules / cjs / loader.js:602:15)     在Function.Module._resolveFilename(/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)     在Function.Module._load(内部/模块/cjs/loader.js:528:25)     在Module.require(internal / modules / cjs / loader.js:658:17)     在要求时(内部/模块/cjs/helpers.js:20:18)     在对象。 (/home/pi/MagicMirror/modules/default/updatenotification/node_helper.js:6:18)     在对象。 (/home/pi/MagicMirror/modules/default/updatenotification/node_helper.js:100:3)     在Module._compile(内部/模块/cjs/loader.js:711:30)     在Object.Module._extensions..js(内部/模块/cjs/loader.js:722:10)     在Module.load(internal / modules / cjs / loader.js:620:32)代码:'MODULE_NOT_FOUND'}

这是我的配置文件 var config = {     address:“ localhost”,//要监听的地址可以是:                           //-“ localhost”,“ 127.0.0.1”,“ :: 1”,以侦听回送接口                           //-另一个特定的IPv4 / 6,以在特定的接口上侦听                           //-“”,“ 0.0.0.0”,“ ::”在任何接口上监听                           //如果省略了地址配置,则默认值为“ localhost”     端口:8080,     ipWhitelist:[“ 127.0.0.1”,“ :: ffff:127.0.0.1”,“ :: 1”],//设置[]以允许所有IP地址                                                            //或添加192.168.1.5的特定IPv4:                                                            // [“ 127.0.0.1”,“ :: ffff:127.0.0.1”,“ :: 1”,“ :: ffff:192.168.1.5”],                                                            //或192.168.3.0的IPv4范围-> 192.168.3.15使用CIDR格式:                                                            // [“ 127.0.0.1”,“ :: ffff:127.0.0.1”,“ :: 1”,“ :: ffff:192.168.3.0/28”],

language: "en",
timeFormat: 24,
units: "metric",

modules: [
    {
        module: "alert",
    },
    {
        module: "updatenotification",
        position: "top_bar"
    },
    {
        module: "clock",
        position: "top_left"
    },
    {
        module: "calendar",
        header: "US Holidays",
        position: "top_left",
        config: {
            calendars: [
                {
                    symbol: "calendar-check",
                    url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"                   }
            ]
        }
    },
    {
        module: "compliments",
        position: "lower_third"
    },
    {
        module: "currentweather",
        position: "top_right",
        config: {
            location: "Daegu,KR",
            locationID: "1835329",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
            appid: ""
        }
    },
    {
        module: "weatherforecast",
        position: "top_right",
        header: "Weather Forecast",
        config: {
            location: "Daegu,KR",
            locationID: "1835329",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
            appid: ""
        }
    },
    {
        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,
            broadcastNewsFeeds: true,
            broadcastNewsUpdates: true
        }
    },
    {
        module: "MMM-Hotword",
        position: "top_right",
        config: {
            chimeOnFinish: null,
            mic: {
                recordProgram: "arecord",
                device: "plughw:1"
            },
            models: [
                {
                    hotwords    : "smart_mirror",
                    file        : "smart_mirror.umdl",
                    sensitivity : "0.5",
                },
            ],
            commands: {
                "smart_mirror": {
                    notificationExec: {
                        notification: "ASSISTANT_ACTIVATE",
                        payload: (detected, afterRecord) => {
                            return {profile:"default"}
                        }
                    },
                    restart:false,
                    afterRecordLimit:0
                }
            }
        }
    },
    {
        module: "MMM-AssistantMk2",
        position: "top_right",
        config: {
            deviceLocation: {
                coordinates: {
                    latitude: 35.857304, // -90.0 - +90.0
                    longitude: 128.4833455, // -180.0 - +180.0
                },
            },
            record: {
                recordProgram : "arecord",  
                device        : "plughw:1",
            },
            notifications: {
                ASSISTANT_ACTIVATED: "HOTWORD_PAUSE",
                ASSISTANT_DEACTIVATED: "HOTWORD_RESUME",
            },
            useWelcomeMessage: "brief today",
            profiles: {
                "default" : {
                    lang: "ko-KR"
                }
            },
        }
    },
]

};

1 个答案:

答案 0 :(得分:0)

查看是否有文件MagicMirror / node_modules / node_helper / index.js 如果不是,请制作文件并复制/粘贴this code

我自己遇到了黑屏问题,这对我来说解决了。