# Persistent EPERM error (operation not permitted, rmdir) during homey app run/build on Windows 11

**URL:** <https://community.homey.app/t/persistent-eperm-error-operation-not-permitted-rmdir-during-homey-app-run-build-on-windows-11/134444>\
**Category:** Developers\
**Tags:** app, zigbee, homey-pro\
**Created:** [April 11, 2025, 2:42am UTC](https://community.homey.app/t/persistent-eperm-error-operation-not-permitted-rmdir-during-homey-app-run-build-on-windows-11/134444 "2025-04-11T02:42:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArneB](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arneb/32/131867_2.png) [@ArneB](https://community.homey.app/u/ArneB)\
**Post date:** [April 11, 2025, 2:42am UTC](https://community.homey.app/t/persistent-eperm-error-operation-not-permitted-rmdir-during-homey-app-run-build-on-windows-11/134444/1 "2025-04-11T02:42:39Z")

</div>

Hi everyone,

I’m new to Homey app development and trying to set up my environment to create my first app (SDK v3). The goal is a Zigbee app for the ID Lock 202 Multi (using the Datek module, identifies as “ID Lock 150” / “Datek”) for my Homey Pro 2023. Unfortunately, I’m completely stuck due to a persistent error during `homey app run` and `homey app build`.

**Problem:** When running `homey app run` or `homey app build` in the project folder, the command fails almost immediately during the “Pre-processing app…” stage with an `EPERM: operation not permitted, rmdir` error. The specific subdirectory it fails on varies (e.g., `...\.homeybuild\assets`, `...\.homeybuild\node_modules\color-space`, `...\.homeybuild\node_modules\hsluv`).

Example error message:

`✓ Pre-processing app... × Error: EPERM: operation not permitted, rmdir 'C:\HomeyDev\com.arnberge.idlockzigbee\.homeybuild\node_modules\color-space'`

_Note:_ On a couple of rare occasions earlier in troubleshooting, I got past the `EPERM` error, but `homey app run` then immediately crashed with `TypeError: Class extends value undefined is not a constructor or null` (even with Node LTS and `homey-zigbeedriver` installed via `npm install`). This might suggest the underlying environment issue also affected runtime, but the `EPERM` error is the consistent blocker now.

**My Environment:**

- **OS:** Windows 11 Pro 24H2
- **Node.js:** v20.19.0 (LTS) (Downgraded from v22.x)
- **Docker Desktop:** v4.40.0 (Engine v28.0.4) using WSL 2 backend (Ubuntu distro confirmed via `wsl -l -v`).
- **homey-cli:** Latest version (globally installed via `npm install -g homey`).
- **Project Location:** `C:\HomeyDev\com.arnberge.idlockzigbee` (Moved from OneDrive to avoid potential conflicts).

**Troubleshooting Steps Attempted (without solving the EPERM error):** I’ve spent considerable time troubleshooting this with an AI assistant, and we’ve tried the following steps without success in resolving the `EPERM` issue:

- Switched from Node.js v22 (Current) to v20 (LTS).
- Ran clean installs of dependencies (`npm install` after deleting `node_modules` and `package-lock.json`) multiple times, including after the Node switch and Docker reset. `npm install` itself completes without errors.
- Moved the project folder out of a OneDrive-synced location to `C:\HomeyDev`.
- Tried running PowerShell as Administrator.
- Added exclusions in Windows Defender (Virus & threat protection → Exclusions) for:
  - The entire project folder (`C:\HomeyDev\com.arnberge.idlockzigbee`).
  - The `node.exe` process.
  - The `com.docker.backend.exe` process.

- Temporarily disabled Windows Defender Real-time protection.
- Checked “Controlled folder access” (it was ON). Tried allowing `node.exe` through it (didn’t help). Also tried temporarily disabling the entire Controlled folder access feature (didn’t help either).
- Ran `docker system prune -a` to clear Docker cache/resources.
- Reset Docker Desktop to factory defaults (via Settings → Troubleshoot → Reset factory defaults).
- Tried running `homey app run` with the `--clean` flag.
- Confirmed WSL 2 is active and used by Docker (`wsl -l -v` shows version 2).

None of these steps have resolved the `EPERM` error during pre-processing. Both `run` and `build` consistently fail at this stage.

Has anyone experienced similar persistent `EPERM` errors on Windows 11 with this combination of tools (Homey CLI, Docker Desktop, WSL2)? Any suggestions for further troubleshooting of the build environment interaction with the filesystem would be greatly appreciated!

Thanks in advance!

Best regards, Arne Berge

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [April 11, 2025, 12:52pm UTC](https://community.homey.app/t/persistent-eperm-error-operation-not-permitted-rmdir-during-homey-app-run-build-on-windows-11/134444/2 "2025-04-11T12:52:44Z")

</div>

Homey Pro 2016-2019:  
`homey app run` starts the app @ selected Homey

Homey Pro 2023:  
`homey app run` starts the app @ docker  
`homey app run --remote` starts the app @ selected Homey

---

<div class="post-metadata">

**Author:** ![ArneB](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arneb/32/131867_2.png) [@ArneB](https://community.homey.app/u/ArneB)\
**Post date:** [April 13, 2025, 4:33pm UTC](https://community.homey.app/t/persistent-eperm-error-operation-not-permitted-rmdir-during-homey-app-run-build-on-windows-11/134444/3 "2025-04-13T16:33:44Z")

</div>

Thanks! I solved this and have a new problem:  
[SDKv3 Zigbee Device (ZigbeeDevice) Fails to Initialize (onNodeInit/Constructor Not Called) After Successful Driver Match via CLI run --remote (ID Lock / Datek) - Developers - Homey Community Forum](https://community.homey.app/t/sdkv3-zigbee-device-zigbeedevice-fails-to-initialize-onnodeinit-constructor-not-called-after-successful-driver-match-via-cli-run-remote-id-lock-datek/134590)
