Failed to generate Photon client: Error: EBUSY: resource busy or locked, open
- Prisma2 version (
prisma2 -v): alpha 765 - Logs from Developer Tools Console, if any:
$ prisma2 studio --experimental
Failed to generate Photon client: Error: EBUSY: resource busy or locked, open 'C:\Users\jcl.maquinay\AppData\Roaming\npm\node_modules\prisma2\query-engine-windows.exe'
at Object.openSync (fs.js:457:3)
at Object.writeFileSync (fs.js:1298:35)
at downloadBinary (C:\Users\jcl.maquinay\AppData\Roaming\npm\node_modules\prisma2\build\index.js:2:2440284)
at async C:\Users\jcl.maquinay\AppData\Roaming\npm\node_modules\prisma2\build\index.js:2:2439772
at async Promise.all (index 0)
at async Promise.all (index 0)
at async Object.download (C:\Users\jcl.maquinay\AppData\Roaming\npm\node_modules\prisma2\build\index.js:2:2439544) {
errno: -4082,
syscall: 'open',
code: 'EBUSY',
path: 'C:\\Users\\jcl.maquinay\\AppData\\Roaming\\npm\\node_modules\\prisma2\\query-engine-windows.exe'
}
Hey @JCLMAQ, it looks like the Prisma Client binary is in use by some other process. Do you have a different prisma2 studio running in another tab?
Perhaps a GraphQL server with nexus-prisma that might be using the same Prisma Client binary?
If that is the case, then we probably need to be smarter about Studio's client generation.
If not, then a previous process did not clean up after itself correctly.
Let me know, and I can try and reproduce this on my end accordingly. Either way, this is a bug.
Hey @madebysid, I do not have another tab with prisma2 studio, but the tab , and I did resatart my computer to be sure to close everything; I do not use graphql neither nexus-prisma for now. I did clean cleanup and get back to preview021 and it's working. I did try with the alpha.770, and I get the error...
@madebysid i'm still not able to run prisma studio while woking with prisma client at the same time and i'm getting the same error, but separately they work perfectly fine. is this a known issue ? primsa version : 2.0.0 os : Windows 10
Can you tell us a bit more @Datlyfe? We would really like to reproduce this - and any input on how you got there would be helpful. If you can reproduce this consistently, maybe create a video of your screen.
@janpio to test it it i just downloaded the Prisma starter project, added an npm script for prisma studio, modified the script.ts a bit and ran the two commands in two different terminal tabs video I'm on WSL2 so the error is not the same as @JCLMAQ, but you will get that error if you run prisma studio first and then run npm dev.
I'm getting the same issue when running prisma generate after installing the latest @prisma/client version. I was also running prisma studio before updating.
Error:
Error: EBUSY: resource busy or locked, copyfile 'D:\Projects\sessions-backend\node_modules\prisma\query_engine-windows.dll.node' -> 'D:\Projects\sessions-backend\node_modules\.prisma\client\query_engine-windows.dll.node'
@JonasHiltl I solved that problem with npm cache clean but if you want you can delete the node_modules folder and reinstall with npm install
I did it with npm cache clean --force and returns me a little warning

If you want more details see https://stackoverflow.com/questions/55081270/getting-error-ebusy-resource-busy-or-locked
Prisma version: 3.3.0 OS: Windows 10
You can try closing all the windows and only open the terminal and try running that command. Worked for me