# TypeError: string.replace is not a function!?

**URL:** https://community.homey.app/t/typeerror-string-replace-is-not-a-function/98545
**Category:** Developers
**Created:** [December 21, 2023, 10:01am UTC](https://community.homey.app/t/typeerror-string-replace-is-not-a-function/98545 "2023-12-21T10:01:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Tjar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tjar/32/61177_2.png) [@Tjar](https://community.homey.app/u/Tjar)
#### Post date: [December 21, 2023, 10:01am UTC](https://community.homey.app/t/typeerror-string-replace-is-not-a-function/98545/1 "2023-12-21T10:01:44Z")

</div>

Hi All,

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

```auto
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?

---

<div class="post-metadata">

### Author: ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)
#### Post date: [December 21, 2023, 10:15am UTC](https://community.homey.app/t/typeerror-string-replace-is-not-a-function/98545/2 "2023-12-21T10:15:39Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Tjar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tjar/32/61177_2.png) [@Tjar](https://community.homey.app/u/Tjar)
#### Post date: [December 21, 2023, 10:45am UTC](https://community.homey.app/t/typeerror-string-replace-is-not-a-function/98545/3 "2023-12-21T10:45:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)
#### Post date: [December 21, 2023, 10:51am UTC](https://community.homey.app/t/typeerror-string-replace-is-not-a-function/98545/4 "2023-12-21T10:51:11Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Tjar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tjar/32/61177_2.png) [@Tjar](https://community.homey.app/u/Tjar)
#### Post date: [December 21, 2023, 11:04am UTC](https://community.homey.app/t/typeerror-string-replace-is-not-a-function/98545/5 "2023-12-21T11:04:27Z")

</div>

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
