ERROR LOADING PLUGIN homebridge-mi-air-purifier:
[1/23/2019, 6:05:27 AM] /opt/nodejs/lib/node_modules/homebridge-mi-air-purifier/index.js:296
getLockPhysicalControls: async function(callback) {
^^^^^^^^
SyntaxError: Unexpected token function
at Object.exports.runInThisContext (vm.js:78:16)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Plugin.load (/opt/nodejs/lib/node_modules/homebridge/lib/plugin.js:72:23)
at Server. (/opt/nodejs/lib/node_modules/homebridge/lib/server.js:149:14)
完整命令:npm install -g homebridge-mi-air-purifier@1.2.2
原因: npm自动安装的版本是1.4,会出现如下错误:
ERROR LOADING PLUGIN homebridge-mi-air-purifier: [1/23/2019, 6:05:27 AM] /opt/nodejs/lib/node_modules/homebridge-mi-air-purifier/index.js:296 getLockPhysicalControls: async function(callback) { ^^^^^^^^ SyntaxError: Unexpected token function at Object.exports.runInThisContext (vm.js:78:16) at Module._compile (module.js:543:28) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Plugin.load (/opt/nodejs/lib/node_modules/homebridge/lib/plugin.js:72:23) at Server. (/opt/nodejs/lib/node_modules/homebridge/lib/server.js:149:14)