LASER-Yi / homebridge-mi-acpartner

XiaoMi AC Partner plugins for HomeBridge(https://github.com/nfarina/homebridge).
MIT License
263 stars 36 forks source link

【0.5.1 Bug】 XiaoMiAcPartner plugin不存在, 0.5.0可以使用 #18

Closed lxy1992 closed 6 years ago

lxy1992 commented 6 years ago

安装配置后跑homebridge,提示'XiaoMiAcPartner'插件不存在。

/usr/lib/node_modules/homebridge/lib/api.js:122
     throw new Error("The requested platform '" + name + "' was not registered by any plugin.");
     ^

Error: The requested platform 'XiaoMiAcPartner' was not registered by any plugin.
   at API.platform (/usr/lib/node_modules/homebridge/lib/api.js:122:13)
   at Server._loadPlatforms (/usr/lib/node_modules/homebridge/lib/server.js:294:45)
   at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:85:36)
   at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
   at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
   at Module._compile (module.js:570:32)
   at Object.Module._extensions..js (module.js:579:10)
   at Module.load (module.js:487:32)
   at tryModuleLoad (module.js:446:12)
   at Function.Module._load (module.js:438:3)
LASER-Yi commented 6 years ago

尝试安装在全局下(-g参数)看看有没有效果

WordlessEcho commented 5 years ago

I am also meet this problem by running homebridge with systemd. It is no problem when I run by head. Here is my systemd script:

cat /usr/lib/systemd/system/homebridge.service 
[Unit]
Description=Node.js HomeKit Server 
Requires=avahi-daemon.service
After=syslog.target network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/homebridge -U /etc/homebridge -D

[Install]
WantedBy=multi-user.target

A workground is that add a line to run it as root:

User=root

But it is unsafe.

LASER-Yi commented 5 years ago

Please check your plugin installation directory. Make sure it’s install with -g(means global) optional and installed in global directory.

Or you can simply just add -P ‘’ to systemd script and use chmod to change readability of plugin directory. This may help.

WordlessEcho commented 5 years ago

I am quite sure that plugin was installed as globally.

ychongsaytc commented 5 years ago

问题依旧存在,版本 homebridge-mi-acpartner@0.7.1

Error: The requested platform 'XiaoMiAcPartner' was not registered by any plugin.
    at API.platform (/root/apps/homebridge/node_modules/homebridge/lib/api.js:134:13)
    at Server._loadPlatforms (/root/apps/homebridge/node_modules/homebridge/lib/server.js:327:45)
    at Server.run (/root/apps/homebridge/node_modules/homebridge/lib/server.js:90:36)
    at module.exports (/root/apps/homebridge/node_modules/homebridge/lib/cli.js:59:10)
    at Object.<anonymous> (/root/apps/homebridge/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)