TypeError: Cannot read property 'indexOf' of undefined
tried everything but every-time i add the plugin i get this:

TypeError: Cannot read property 'indexOf' of undefined
    at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:108:12)
    at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:316:45)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:86:36)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:45:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3