TypeError: string.replace is not a function!?

Hi All,

I had a working system YESTERDAY on and now I suddenly get this errors:

c:\Users\me\Documents\GitHub\mennekes.modbus>homey app run
× TypeError: string.replace is not a function
    at fn (C:\Users\me\AppData\Roaming\npm\node_modules\homey\node_modules\figures\index.js:143:19)
    at module.exports (C:\Users\me\AppData\Roaming\npm\node_modules\homey\lib\Log.js:9:18)
    at Settings._getSettings (C:\Users\me\AppData\Roaming\npm\node_modules\homey\lib\Settings.js:44:34)
    at async Settings.get (C:\Users\me\AppData\Roaming\npm\node_modules\homey\lib\Settings.js:51:5)
    at async AthomApi.getActiveHomey (C:\Users\me\AppData\Roaming\npm\node_modules\homey\lib\AthomApi.js:206:25)
    at async App.run (C:\Users\me\AppData\Roaming\npm\node_modules\homey\lib\App.js:137:19)
    at async exports.handler (C:\Users\me\AppData\Roaming\npm\node_modules\homey\bin\cmds\app\run.js:43:5)

I did not change anything! No code, no nothing.

I can validate, build, but Run throws me there strange errors.

Anyone a idea?

The homey app is trying to read its settings file (on Windows that’s probably C:\Users\me\AppData\Roaming\athom-cli\settings.json, not sure) and failing. I can’t say why.

I tried to reinstall homey npm package

  • removed any possible local packages “npm uninstall homey”
  • removed any possible global packages “npm uninstall -g homey”
  • re-installed global package “npm install -g homey”

Did not resolve the error.

As I said, the issue is with the settings file. That will not be removed or overwritten when you (re-)install the homey executable.

Ah right,

The json was empty, but the homey cli directory contained data.
Removed the complete dir and after that it seems to work again… strange, but resolved!

@robertklep
Correction, It could run “homey app run” ONCE. After quiting with ctrl+c I tried again with homey app run, but it gives again the initial errer.

Best regards