Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error An unexpected error occurred: "EPERM: operation not permitted, unlink 'path_to_project\\node_modules\\prisma\\query_engine-windows.dll.node'

I installed Prisma and I run npx primsa db push it pushed all tables to database successfully, after that I run npx prisma generate it tried to install @prisma/client and it fails with this error message:

error An unexpected error occurred: "EPERM: operation not permitted, unlink 'path_to_project\node_modules\prisma\query_engine-windows.dll.node'

I tried to remove node_modules and re-install all modules but it not worked.

like image 656
Ghyath Darwish Avatar asked May 06 '26 06:05

Ghyath Darwish


2 Answers

If you are running nextjs server. Close the server and try running the command again.

$ npx prisma generate
like image 199
Amrit Sharma Avatar answered May 07 '26 21:05

Amrit Sharma


Closing all processes and re-running the command worked for me.

like image 25
Dave Odipo Avatar answered May 07 '26 19:05

Dave Odipo