我有ReactJS的经验,我已经建立了与反应网络应用程序。但是我已经看到了来自https://github.com/deepsyx/home-automation的家庭自动化。
我曾尝试在" server“目录下运行服务器,但这是错误的
me:server mai$ node index.js
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'home-config'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/mai/Documents/Workspace/home-automation/server/index.js:13:20)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)如何修复此错误?
这个项目很酷,有人有步骤来运行这个项目吗?
提前谢谢!
me:server mai$ cat package.json
{
"name": "home-automation",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Viktor Kirilov (deepsybg@gmail.com)",
"license": "MIT",
"dependencies": {
"home-config": "file:../home-config",
"home-records": "file:../home-records",
"ws": "1.1.1"
}
}发布于 2019-04-17 14:30:47
我用它来运行家庭自动化服务器。我希望这能帮助所有像我这样的新手在Raspberry Pi上实现家庭自动化。
我发现了两个步骤:
const homeConfig = require('../home-config');中向const homeConfig = require('home-config');添加"../“,但由于没有raspberry pi环境,无论如何无法运行。const deviceFolder = files.find(file => /^10/.test(file));修复为const deviceFolder = files.find(file => /^28/.test(file));,因为raspberry pi 3生成"28-01131faf1feb目录”。https://stackoverflow.com/questions/55652040
复制相似问题