Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: EPERM: operation not permitted, lstat (gatsby-starter-default + gatsby-source-wordpress) #16353

Closed
mavalon opened this issue Aug 3, 2019 · 11 comments

Comments

@mavalon
Copy link

mavalon commented Aug 3, 2019

Description

I installed the default starter and the wordpress plugin. Running develop compiles successfully. But, a few seconds later an error is thrown.

Steps to reproduce

  • Install gatsby-starter-default
  • Install gatsby-source-wordpress
  • Run gatsby develop
  • Open the site in a browser (I'm using Chrome)

Expected result

  • The page should load properly

Actual result

  • The browser error: "This site can’t be reached. localhost refused to connect."
  • The server has now stopped, and the error in the terminal is:
5 pages                                                                                                                                                                                gatsby-starter-default

C:\Users\Username\AppData\Local\Yarn\config\global\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
        throw ex;
        ^

Error: EPERM: operation not permitted, lstat 'C:\htdocs\sandboxes\gatsby-project\.cache\gatsby-source-filesystem\tmp-d95d3893f542f53189a060463b734974.jpg'
    at Object.lstatSync (fs.js:845:3)
    at Object.lstatSync (C:\htdocs\sandboxes\gatsby-project\node_modules\graceful-fs\polyfills.js:302:16)
    at Object.rimrafSync [as removeSync] (C:\htdocs\sandboxes\gatsby-project\node_modules\fs-extra\lib\remove\rimraf.js:237:18)
    at DuplexWrapper.responseStream.on (C:\htdocs\sandboxes\gatsby-project\node_modules\gatsby-source-wordpress\node_modules\gatsby-source-filesystem\create-remote-file-node.js:162:8)
    at DuplexWrapper.emit (events.js:198:13)
    at Timeout.setTimeout [as _onTimeout] (C:\htdocs\sandboxes\gatsby-project\node_modules\got\index.js:205:10)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

Environment

System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
    Yarn: 1.3.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.10.2 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.6.2 - C:\Users\Michael\AppData\Local\Programs\Python\Python36\python.EXE
  Browsers:
    Edge: 38.14393.1066.0
  npmPackages:
    gatsby: ^2.13.45 => 2.13.45
    gatsby-image: ^2.2.7 => 2.2.7
    gatsby-plugin-manifest: ^2.2.4 => 2.2.4
    gatsby-plugin-offline: ^2.2.4 => 2.2.4
    gatsby-plugin-react-helmet: ^3.1.2 => 3.1.2
    gatsby-plugin-sharp: ^2.2.9 => 2.2.9
    gatsby-source-filesystem: ^2.1.7 => 2.1.7
    gatsby-source-wordpress: ^3.1.13 => 3.1.13
    gatsby-transformer-sharp: ^2.2.5 => 2.2.5

Additional info

Also, I notice that immediately after it says that it compiled successfully, I can see image files in the .cache/gatsby-source-filesystem directory. But, a few moments later, when the error above occurs and the server is stopped, all the files disappear. (Perhaps it's normal to remove the files when the server stops, but I thought I'd mention that here, just in case it's not.)

Also, if I comment out the media path in gatsby-config for the wordpress plugin configuration section, then I get no errors:

              includedRoutes: [
                  "**/categories",
                  "**/posts",
                  "**/pages",
                  // "**/media",
                  "**/menus",
                  "**/tags",
                  "**/taxonomies",
                  "**/users",
              ],
@wardpeet
Copy link
Contributor

wardpeet commented Aug 5, 2019

Hi @mavalon!

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it. I can't seem to reproduce this on my own.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! 💜

@mavalon
Copy link
Author

mavalon commented Aug 15, 2019

I ended up switching to gatsby-source-graphql (instead of using gatsby-source-wordpress) to avoid the many issues I was having.

@mavalon mavalon closed this as completed Aug 15, 2019
@MiaadZ
Copy link

MiaadZ commented Apr 20, 2020

Happened to me while my VScode was Open so i closed it and used to run gatsby develop on cmd and it worked .

@sudhanshu786kumar
Copy link

I had same issue this worked for me just type gatsby clean and then restart again by typing gatsby develop

@CalebBarnes
Copy link
Contributor

I had same issue this worked for me just type gatsby clean and then restart again by typing gatsby develop

Really annoying to have to gatsby clean when this issue happens constantly.

@ReubenJCarter
Copy link

I can't even run gatsby clean anymore, as the same error is happening there too!

@CalebBarnes
Copy link
Contributor

This still happens very often. I am on Windows 11 using the new Powershell. Seems like it has something to do with Windows permissions.

@uno-b
Copy link

uno-b commented Sep 12, 2022

This still happens very often. I am on Windows 11 using the new Powershell. Seems like it has something to do with Windows permissions.

Have you found a solution to this? I'm also using Windows 11. I've tried closing VS code and running gatsby develop but to no avail.

@maxenko
Copy link

maxenko commented Mar 25, 2023

Running into this as well, possibly linked to hot reload working inconsistently (needs a restart).

@bartlomiej-makina
Copy link

this issue still exists, win11

@ReubenJCarter
Copy link

this solved it for me https://nextjs.org/ 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants