【问题标题】:Error found: Error: Cannot find module 'node_helper'发现错误:错误:找不到模块“node_helper”
【发布时间】:2019-10-18 05:21:37
【问题描述】:

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

启动魔镜: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 (internal/modules/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 (internal/modules/cjs/loader.js:711:30) 在 Object.Module._extensions..js (internal/modules/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 (internal/modules/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 (internal/modules/cjs/loader.js:711:30) 在 Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10) 在 Module.load (internal/modules/cjs/loader.js:620:32) 代码:'MODULE_NOT_FOUND' }

这是我的配置文件 变量配置 = { 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 地址 // 或添加特定的 IPv4 192.168.1.5 : // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"], // 或 IPv4 范围 192.168.3.0 --> 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"
                }
            },
        }
    },
]

};

【问题讨论】:

    标签: raspberry-pi3 raspbian magic-mirror


    【解决方案1】:

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

    我自己刚刚遇到了黑屏问题,这为我解决了。

    【讨论】:

      猜你喜欢
      • 2018-12-30
      • 1970-01-01
      • 2019-06-30
      • 1970-01-01
      • 2016-12-20
      • 1970-01-01
      • 2014-05-25
      • 2020-03-13
      • 2017-01-29
      相关资源
      最近更新 更多