matthiasott / eleventy-plus-vite

A clean and fast Eleventy Starter Project with Vite
https://eleventyplusvite.netlify.app
MIT License
197 stars 32 forks source link

[BUG]: build error #5

Open murtuzaalisurti opened 2 years ago

murtuzaalisurti commented 2 years ago

Code_zIK0163mqc

matthiasott commented 2 years ago

Hi @murtuzaalisurti! Thanks for opening this issue! 😄

When did you experience this error? When running npm run build? I can’t reproduce it, unfortunately, but it seems to be related to file permissions in your working folder. The build fails because it is not possible to rename the temporary folder generated by Eleventy into the final output folder for Vite. Is your current npm user allowed to rename files/folders? Ideally, you don’t run npm scripts as admin but your user still needs to have the necessary rights. You could also try to delete both the _site and the temporary .11ty-vite folder (which normally should be renamed and then deleted but maybe something went wrong with a build) and try again.

And, when I searched online for your EPERM: operation not permitted error, I also stumbled upon this possible solution – in case you are using VS Code…? https://stackoverflow.com/questions/39293636/npm-err-error-eperm-operation-not-permitted-rename

Let me know if you find a solution or otherwise are able to provide me with a few more details so I can try to reproduce it myself. Good luck and all the best!

murtuzaalisurti commented 2 years ago

Running as an administrator also didn't work. I tried the above solution but didn't help. Also, running different node and npm versions did nothing.

gsmartagence commented 1 year ago

This workaround fixed the build task for me (Node18/Windows11): https://github.com/11ty/eleventy-plugin-vite/issues/22#issuecomment-1539443517