prisma: Receiving this error: Command failed with exit code 3221225781

Bug description

I am following this guide to setup a prisma project. When I run the prisma migrate command npx prisma migrate dev --name init, I receive this error:

Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Error: Get config: Error: Command failed with exit code 3221225781: C:\Users\ahmed\Desktop\hello-prisma\node_modules\@prisma\engines\query-engine-windows.exe cli get-config

I also tried other commands like npx prisma dub push --preview-feature and npx prisma generate and I am receiving the same error above. I tried deleting all the cache in %AppDate% related to prisma and npm and also tried reinstalling node.js, tried using a sqlite database instead of postgres but nothing worked.

In addition to that error, also the prisma formatting extension is not working and gives me this error:

prisma-fmt error'd during formatting. To get a more detailed output please see Prisma Language Server output. To see the output, go to View > Output from the toolbar, then select 'Prisma Language Server' in the Output panel.

and this is output I get in vscode output window:

prisma-fmt error'd during formatting. Please report this issue on [Prisma Language Tools](https://github.com/prisma/language-tools/issues).

[Info  - 12:03:44 PM] Prisma plugin prisma-fmt installation succeeded.
[Info  - 12:03:44 PM] Installed version  of 'prisma-fmt' using path: c:\Users\ahmed\.vscode\extensions\prisma.prisma-2.20.1\node_modules\@prisma\language-server\dist\src\prisma-fmt\prisma-fmt.60ba6551f29b17d7d6ce479e5733c70d9c00860e.exe
[Error - 12:03:44 PM] Language Server failed while downloading url https://binaries.prisma.sh/all_commits/60ba6551f29b17d7d6ce479e5733c70d9c00860e/windows/prisma-fmt.exe.gz with fmtPath c:\Users\ahmed\.vscode\extensions\prisma.prisma-2.20.1\node_modules\@prisma\language-server\dist\src\prisma-fmt\prisma-fmt.60ba6551f29b17d7d6ce479e5733c70d9c00860e.exe.
[Error - 12:03:44 PM] [object Object]
[Error - 12:03:44 PM] Cannot install prisma-fmt: EBUSY: resource busy or locked, copyfile 'C:\Users\ahmed\AppData\Local\Temp\ce5080633ae91aaa2f26d7f695b36a06\partial' -> 'c:\Users\ahmed\.vscode\extensions\prisma.prisma-2.20.1\node_modules\@prisma\language-server\dist\src\prisma-fmt\prisma-fmt.60ba6551f29b17d7d6ce479e5733c70d9c00860e.exe'. Please:
1. Check your network connection and run `Prisma: Restart Language Server`, or
2. Manually download and uncompress the archive file, then set the path in `prisma.prismaFmtBinPath`

The achieve file can be acquired at:
  https://binaries.prisma.sh/all_commits/60ba6551f29b17d7d6ce479e5733c70d9c00860e/windows/prisma-fmt.exe.gz


[Error - 12:03:44 PM] prisma-fmt error'd during linting.

So, yeah, everything related to prisma is broken for me and I really need to start this project as soon as possible.

How to reproduce

this guide

Expected behavior

this guide

Prisma information

this guide

Environment & setup

  • OS: Windows
  • Database: PostgreSQL/SQLite
  • Node.js version: v14.16.1
  • Prisma version:
2.20.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Alright, I installed Microsoft Visual C++ 2015 Redistributable and It worked

But still, This leaves me confused. Do you have this program installed on your windows machine? If so, then, Does it come preinstalled with your windows installation or did you manually install it?

I think that this is something the the rust team should be aware of.

Any way, Thank you so much, my problem is solved and everything is working fine now.

Install Visual C++ redistributable and error will be fixed

I tried hard but could not find any Windows computer in this household where the problem you described occured.

If we ever get another report of this, I will remember this issue and come back to this and reopen it. Until then, I am happy we could fix this for you.

I am really sorry I forgot to mention that when I manually downloaded those files and ran them, I had this error about a missing DLL file Capture Then I downloaded this DLL file manually and included everything in the same folder and It worked.

I thought that my windows is broken, so, I reinstalled it. Sadly, that didn’t fix anything. so, It’s probably not a problem with my windows system.

What Windows version? Any special software running on the computer (Enterprise stuff, antivirus maybe)? You can use other Node tooling as usual? Anything with Docker in your toolchain you are using here? WSL?