KraigM / HomeBridgeController

Provides a simplified UI for controlling your HomeBridge
87 stars 7 forks source link

TypeError: chalk.stripColor is not a function error ? #71

Open livefeed opened 7 years ago

livefeed commented 7 years ago

My homebridge does not want to load anymore, i get this error and don't know how to fix it, any help would be great please.

Home-Mac-Mini:~ martinc$ homebridge [7/30/2017, 7:09:57 PM] Warning: skipping plugin found at '/usr/local/lib/node_modules/homebridge-controllerlink' since we already loaded the same plugin from '/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink'. /Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/lib/logger.js:93 return chalk.stripColor(line + log + '\n'); ^

TypeError: chalk.stripColor is not a function at getLineString (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/lib/logger.js:93:15) at Logger.queueLog (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/lib/logger.js:125:24) at console.(anonymous function) (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/lib/logger.js:113:9) at Logger.log (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge/lib/logger.js:72:3) at Logger.info (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge/lib/logger.js:36:12) at Server. (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge/lib/server.js:147:11) at Array.forEach (native) at Server._loadPlugins (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge/lib/server.js:128:22) at new Server (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge/lib/server.js:51:24) at module.exports (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge/lib/cli.js:26:16) at Object. (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:313:12) at Function.Module.runMain (module.js:467:10) at startup (node.js:136:18) at node.js:963:3

troystanway commented 7 years ago

I am also getting this error! :(

livefeed commented 7 years ago

Would love to have this back working, is the developer still active on this?

c0mm0n commented 7 years ago

Getting this too.

c0mm0n commented 7 years ago

Got it installed by removing the function (doesn't seem important).

Edit this file : (path from my nix container) /usr/local/lib/node_modules/homebridge-controllerlink/lib/logger.js

On line 93 Turn this : return chalk.stripColor(line + log + '\n');

into this: return line + log + '\n';

And no more error installing, it's running now. But the OS X app doesn't find it :D

c0mm0n commented 7 years ago

Got it working now, had this issue. https://github.com/KraigM/HomeBridgeController/issues/64#issuecomment-258587001

So seems the fix I suggest doesn't break the plugin and should get you through.

livefeed commented 7 years ago

Thank you for working on this, I am getting this error;

6/devices.json/ path.js:8 throw new TypeError('Path must be a string. Received ' + ^

TypeError: Path must be a string. Received undefined at assertPath (path.js:8:11) at Object.posix.resolve (path.js:426:5) at Conf.loadPrefix (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/nodemodules/npm/lib/config/load-prefix.js:43:14) at load (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/node_modules/npm/lib/config/core.js:109:8) at Conf. (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/node_modules/npm/lib/config/core.js:96:5) at emitOne (events.js:77:13) at Conf.emit (events.js:169:7) at ConfigChain._resolve (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/node_modules/npm/node_modules/config-chain/index.js:281:34) at ConfigChain.add (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/node_modules/npm/node_modules/config-chain/index.js:259:10) at Conf.add (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/node_modules/npm/lib/config/core.js:341:27) at Conf. (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/node_modules/npm/lib/config/core.js:320:25) at ReadFileContext.callback (/Users/martinc/.nvm/versions/node/v4.2.4/lib/node_modules/homebridge-controllerlink/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16) at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:303:13) Home-Mac-Mini:~ martinc$

c0mm0n commented 7 years ago

Solution is in the link I've posted

livefeed commented 7 years ago

Thank you, for some odd reason I have two homebridge folders, fold the one above made the changes you recommended and its working!