The error npm ERR! Error: EPERM: operation not permitted, rename occurs when your project is actively running, locking certain files and preventing npm from modifying them.
Stop the Running Project
Use Ctrl + C in the terminal or terminate any background process using the project files.
After stopping the project, retry the command that caused the error.
Retry Desired command
After the command completes, restart your project.
Restart Project
Why This Happens ?
When a project is actively running, it locks certain files in the project directory. This lock prevents npm from performing operations that involve renaming, modifying, or deleting files. By stopping the running process, you allow npm to proceed without interference.