seikan / homebridge-mi-air-purifier

A Xiaomi Mi air purifier plugin for Homebridge.
Other
172 stars 65 forks source link

Default version via npm is 1.4 which cause problem #65

Closed haoyang324 closed 1 month ago

haoyang324 commented 5 years ago

完整命令: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)

haoyang324 commented 5 years ago

Recommendation: install plugin with @1.2.2 npm install -g homebridge-mi-air-purifier@1.2.2