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.
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:
- Stop your dev server.
- Delete the
.svelte-kitdirectory in your project root. - 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! :)