Digital Dreamer
Writing /
Read on dev.to

Fix for EPERM: operation not permitted (...$types.d.ts)

I had an issue running my sveltekit dev server. I kept getting this issue: EPERM: operation not permitted (...$types.d.ts). Here's how to fix it.

Fix for EPERM: operation not permitted (...$types.d.ts)

I had an issue running my sveltekit dev server. I kept getting this issue:

text
EPERM: operation not permitted, open 'C:\path\to\project\.svelte-kit\types\src\routes\$types.d.ts'

This usually happens when a process (like your IDE or another dev server) is locking the file, or if there are permission issues in the .svelte-kit directory.

The Fix:

  1. Stop your dev server.
  2. Delete the .svelte-kit directory in your project root.
  3. Restart your dev server.
bash
rm -rf .svelte-kit
npm run dev

This forces SvelteKit to regenerate all the type definitions and usually clears up the EPERM error.

Happy hacking! :)