Error: EPERM: operation not permitted, mkdir 'C:\'

When I start my Vaadin Spring Boot application , I get the following error message:

```Command C:\Program Files\nodejs\node.exe C:\Users\lasse\Development\vp-mediathek\node_modules\vite\bin\vite.js build failed:
error during build:
Error: EPERM: operation not permitted, mkdir 'C:'
at mkdirSync (node:fs:1405:3)
at C:\Users\lasse\Development\vp-mediathek\vite.config.ts:123:31
at Array.forEach ()
at C:\Users\lasse\Development\vp-mediathek\vite.config.ts:119:28
at Array.forEach ()
at copyStaticAssets (C:\Users\lasse\Development\vp-mediathek\vite.config.ts:117:23)
at handleThemes (C:\Users\lasse\Development\vp-mediathek\vite.config.ts:470:5)
at findThemeFolderAndHandleTheme (C:\Users\lasse\Development\vp-mediathek\vite.config.ts:430:23)
at processThemeResources (C:\Users\lasse\Development\vp-mediathek\vite.config.ts:417:5)
at config (C:\Users\lasse\Development\vp-mediathek\vite.config.ts:1054:7)

My vite.config.ts is the default one.
I am currently despairing of this error. I have already cleared the cache, run `vaadinClean `Goal with Gradle, and reinstalled NPM. All unfortunately without success.

Vaadin version: 24.1.4
Node: 20.4.0

Can you try with a different node version (e.g. 18.16.1) or setting requireHomeNodeExec=true in the Vaadin gradle plugin configuration?

Unfortunately I get the same error:
Command `C:\Users\lasse\.vaadin\node\node.exe C:\Users\lasse\Development\vp-mediathek\node_modules\vite\bin\vite.js build` failed: error during build: Error: EPERM: operation not permitted, mkdir 'C:\'
The version of node installed from vaadin in my home directory is v.18.16.1

Does the same happen if you run the command directly from the CLI?

C:\Users\lasse\.vaadin\node\node.exe C:\Users\lasse\Development\vp-mediathek\node_modules\vite\bin\vite.js build

When I run the provided command I get the following error:

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: EPERM: operation not permitted, scandir 'C:\Users\lasse\AppData\Local\Temp\WinSAT'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'scandir',
  path: 'C:\\Users\\lasse\\AppData\\Local\\Temp\\WinSAT'
}

Node.js v18.16.1```

Did you run it from the project root, where the vite.config.ts file is?
You can try to check if the contents of the vaadin-dev-server-settings.json file seems correct
In a maven project it is under the target dir, for gradle I don’t remember

Unfortunately, I’m not a windows user so I cannot provide many suggestions

Sorry my mistake. I ran the command from the project root and get the operation not permitted, mkdir 'C:' error again. The vaadin-dev-server-settings.json file seems to be correct. Should I create a github issue?

Can you post the contents of vaadin-dev-server-setting.json (you can clear sensitive data, but please preserve path separators)

Sure, here you go:

  "frontendFolder": "C:/Users/lasse/Development/vp-mediathek/frontend",
  "themeFolder": "themes",
  "themeResourceFolder": "C:/Users/lasse/Development/vp-mediathek/frontend/generated/jar-resources",
  "staticOutput": "C:/Users/lasse/Development/vp-mediathek/build/classes/META-INF/VAADIN/webapp/VAADIN/static",
  "generatedFolder": "generated",
  "statsOutput": "C:\\Users\\lasse\\Development\\vp-mediathek\\build\\classes\\META-INF\\VAADIN\\config",
  "frontendBundleOutput": "C:\\Users\\lasse\\Development\\vp-mediathek\\build\\classes\\META-INF\\VAADIN\\webapp",
  "devBundleOutput": "C:/Users/lasse/Development/vp-mediathek/src/main/dev-bundle/webapp",
  "devBundleStatsOutput": "C:/Users/lasse/Development/vp-mediathek/src/main/dev-bundle/config",
  "jarResourcesFolder": "C:/Users/lasse/Development/vp-mediathek/frontend/generated/jar-resources",
  "themeName": "vp-mediathek",
  "clientServiceWorkerSource": "C:\\Users\\lasse\\Development\\vp-mediathek\\build\\sw.ts",
  "pwaEnabled": false,
  "offlineEnabled": false,
  "offlinePath": "'offline.html'"
}```

interesting that there are mixed separators. May I ask you to change all path \\ to / and try to run the command again from CLI?

I have already done this because it also seemed strange to me. In fact, the same thing can be found in other projects.

And the other projects are working correcty?

Yes they work perfectly

And when you change the path separators in the json file, is the error the same, mentioning C:\?

Yes unfortunately I get the same error

No ideas. Please create an issue on GitHub, adding all the above info (errors, json file, …) and, if possible, a simple project that reproduce the issue.
It would be very helpful for us to investigate further