How can I resolve 'EPERM: operation not permitted' when building a Next.js project?

Question

Grade: Education Subject: Support
How can I resolve 'EPERM: operation not permitted' when building a Next.js project?
Asked by:
83 Viewed 83 Answers

Answer (83)

Best Answer
(352)
To resolve this, try running your build command (e.g., `npm run build` or `yarn build`) with administrator privileges or in an elevated command prompt. Alternatively, check if any other processes are currently using the files or directories involved in the build, and close them. Ensure your project directory is not located in a system-protected area.