gatsby-source-strapi icon indicating copy to clipboard operation
gatsby-source-strapi copied to clipboard

EPERM /gatsby-source-filesystem issue on Windows 10

Open stratogod opened this issue 6 years ago • 12 comments

Hey guys, thanks for the plugin. I have run into an issue that I can't seem to resolve. I have narrowed it down to something with how this plugin works with the gatsby-source-filesystem and if I try to query images from Strapi.

Whenever I run 'gatsby develop' everything compiles fine and runs for probably 5-10 seconds then crashes with the following error:

Error: EPERM: operation not permitted, lstat 'C:\Users\steve\Development\GitHub\project.cache\gatsby-source-filesystem\tmp-d3b56b8057af32564415970b4fa22b46.png'

I have tried manually changing the permissions to that directory using a variety of methods and nothing fixes it... it will always go back anyways since it is regenerated in the cache folder. I also have disabled all anti-virus/firewalls to make sure, as well.

Note that this doesn't happen when I 'gatsby build' and then 'gatsby serve' or deploy the site - all is fine then. Only happens in develop.

I am calling images in my graphql - which I believe is the issue, as well:

allStrapiNews(sort: {fields: [date], order: DESC}) { edges { node { id image { url } ...

I have:

Node.js - 10.14.1 yarn - 1.13.0 Gatsby - 2.2.0 Gatsby CLI - 2.4.16 Strapi - 3.0.0-alpha.25.2

I'll be happy to provide more information if needed. Any help would be greatly appreciated!!

Thanks, Steve

stratogod avatar Mar 19 '19 16:03 stratogod

Yeah I have the same issue. I have found out that removing the .cache folder and the public folder fixes it. I think the cache is the problem as some files are cached by your browser. I am not sure about that, though.

rori4 avatar May 30 '19 14:05 rori4

this is a reall issue and seems happens from time to time!

x5engine avatar Jul 16 '19 13:07 x5engine

This sometimes occurs if you are adding and deleting images. At the moment, deleting the gatsby cache has been the only way to solve this and continue. (At the moment these changes sometimes do not invalidate the gatsby cache.)

Please note, that Strapi on Windows is best done running in the Windows Subsystem for Linux.

davidkartuzinski avatar Jul 16 '19 14:07 davidkartuzinski

Having similar issue here, I just added the plugin, and ran gatsby develop, then this happens

image

I tried clearing cache with gatsby clean but doesn't help. So I am stuck...

Any ideas how to solve this?

hayk94 avatar Jul 08 '20 21:07 hayk94

I no longer get this error, so not sure if a recent update of this module or the strapi one I used, however - for those that continue to get it AND use gatsby-source-strapi.

Edit the below file:

/node_modules/gatsby-source-strapi/ normalize.js Comment out Line 121

Or look for the line that is: cache: cache

and comment it out.

stratogod avatar Jul 09 '20 19:07 stratogod

I'm getting this issue and gatsby clean does not fix the issue..

The issue has come out of nowhere, unless gatsby can fix these silly issues that continue to popup, I can't commit my agency to use the stack

DanielYorwarth avatar Apr 27 '21 16:04 DanielYorwarth

We're also experiencing this issue on Windows 10 when sourcing remote images using createRemoteFileNode(). I've tried running 'gatsby clean' and this makes no difference. Have also tried closing visual studio code and running the command prompt as administrator.

tim-line avatar Jul 02 '21 16:07 tim-line

We're also experiencing this issue on Windows 10 when sourcing remote images using createRemoteFileNode(). I've tried running 'gatsby clean' and this makes no difference. Have also tried closing visual studio code and running the command prompt as administrator.

Did you anyhow get the solution for this? I'm on Windows 10 and literally tried everything like deleting .cache and public folders, reinstalling all packages but this issue continues to popup.

SyedMinhalHasan avatar Aug 02 '21 16:08 SyedMinhalHasan

This issue is still happening. I have removed my whole project and again cloned from github and install all the node modules. Also gave the all permissions for folders and subfolders. Tried gatsby clean and reinstalling node_modules as well.

Did anyone find any solution for this😥?

codebucks27 avatar Dec 06 '21 07:12 codebucks27

This issue is happening for me too, like everyone else- on Windows 10, tried gatsby-clean, tried reinstalling node_modules, no luck- please send help.

LukeVibes avatar Dec 15 '21 18:12 LukeVibes

I ended up installing WSL (windows subsystem for linux). Using WSL you can run linux in windows without installing separate OS. You have to install nodeJS into the WSL. I have cloned repo in linux and now it's working without any issue.

I think this issue happening only in windows. Still if you face this issue in any other OS then you can try to tweak these variables https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem#troubleshooting

codebucks27 avatar Dec 23 '21 06:12 codebucks27

I tried deleting the .cache and public folders and ran gatsby clean , after that I did gatsby build and then gatsby develop which fixed my issue

sravanV97 avatar Dec 30 '21 09:12 sravanV97

Thanks for your interest in this project. This plugin is moving into the Gatsby User Collective and this repo will be archived. Please open an issue in that repository, submit a PR if you'd like to see this implemented, or join us on Discord if you have questions!

moonmeister avatar Dec 27 '22 18:12 moonmeister