Next JS : Error: EPERM: operation not permitted, rmdir

  next.js, node.js, npm, reactjs, windows

I have a Next.js application that works and then when I leave it and come back to it I get

  errno: -4048,
  code: 'EPERM',
  syscall: 'rmdir',
  path: 'C:UsersgmacrGoogle DriveOptical-Font-WebsiteO.nextserverpages'
npm ERR! errno 1
npm ERR! [email protected] dev: `next dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersgmacrAppDataRoamingnpm-cache_logs21-10-16T21_14_26_886Z-debug.log 

I tried using npm clean cache. using Windows 10. When I create a new Next app and copy my working files over the program runs without error until I leave it for a while and come back to it…

Source: Windows Questions