Next.js Discord

Discord Forum

glob error [Error: EPERM: operation not permitted, scandir

Unanswered
Britannia Petite posted this in #help-forum
Open in Discord
Britannia PetiteOP
error when build next on windows 11

pnpm build


glob error [Error: EPERM: operation not permitted, scandir 'C:\Users\john\Application Data'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'scandir',
  path: 'C:\\Users\\john\\Application Data'
}


i got error when i try to build Nextjs, how to solve it ?

how to solve it? thanks

9 Replies

Toyger
you need to run terminal as Administrator,
but tbh It probably shouldn't ask access to Application Data.
looks like pnpm have some problems with permissions https://github.com/pnpm/pnpm/issues/3699
Maybe you should use another package manager.
Britannia PetiteOP
I've tried to run as Administrator, same error,

thanks for the link, I'll check
Britannia PetiteOP
I think I can track back to my code

the error start occur when I'm using next-auth

my guess the error related to how next-auth save cookies or session

any body have some error when using next-auth during building with pnpm ?

I also have tried using yarn to build, and the error is same,

so I guess it's related to next-auth
@Forest bachac Did you end up fixing it?
Toyger
you can try stop dev server
then run:
npm cache clean --force
probably will take couple minutes at least
and start app again
@Toyger you can try stop dev server then run: `npm cache clean --force` probably will take couple minutes at least and start app again
Forest bachac
I don't have the dev server running, tried npm cache clean --force, tried deleting node_modules and installing again, but same issue.
have you tried running from a different directory? like a user perms based folder?
Pine Bunting
@Britannia Petite Hey, have you found a solution other than reinstalling the PC?