-1

Ok bare with me please. When running Vite in my Laravel 10 installation with npm run dev the API call's of my webapp run into the following error:

Unable to create lockable file: C:\Websites\website.nl\storage\framework/cache/data/03/bc/03bc23b61d4cf128f2bd79541d52e1b98f18c79d. Please ensure you have permission to create files in this location.

I am running on Windows. But I can use the bash command that brings me to a Linuxy place thanks to WSL... But I am not sure if that means if I can just do commands like chmod there. It is kinda new to me.

In short: When running the ViteJs dev server the file permissions are incorrect in the storage folder.

I tried giving the chmod 775 to the storage folder (via the bash command). And also tried to change the owner of the storage folder and subfolders to www-data.

All to no avail.

So how to fix this error in Windows? Thanks!

BTW: this happens only when running the ViteJs dev server. I also can't run php artisan cache:clear when running the ViteJs dev server.

Then I will get this error: ERROR Failed to clear cache. Make sure you have the appropriate permissions.

UPDATE: After testing for a while I noticed that this problem accurs after like a minute or so of refreshing pages with Vite and hot reloading. After a minute the 1 of the file changes to a 0. See picture below.

enter image description here

Floris
  • 2,727
  • 2
  • 27
  • 47

1 Answers1

0

First I had to remove WSL from Windows (via the optional Windows features removal of Windows). Then the bash command gave errors in ViteJs. So I applied the solution mentioned here. And finally I removed the package-lock.json, the node_modules folder and ran npm i.

NOW everything works fine.

Floris
  • 2,727
  • 2
  • 27
  • 47