'prisma' is not recognized as an internal or external command, operable program or batch file
Asked Answered
G

5

15

Hi everyone I am getting this error "'prisma' is not recognized as an internal or external command, operable program or batch file." while running prisma login command in cmd I have installed the prisma globally with npm install -g prisma any solution will be appreciated.

enter image description here

Gustafsson answered 24/1, 2019 at 9:30 Comment(0)
E
3

It isn't a problem with prisma, but with how you configured your PATH on Windows.

Windows doesn't know where is prisma, so you must tell him where to look.

See this answer to learn how to do that: Nodejs cannot find installed module on Windows?

Eloquent answered 24/1, 2019 at 10:4 Comment(0)
V
18

Install it globally with; npm i -g prisma

Vexillum answered 5/7, 2019 at 1:22 Comment(2)
This should be the accepted answer; simple clear & is the resolution.Jorie
This is just a workaround. Author said he installed prisma globally. Sometimes you don't want to or simply cannot install modules as global. Also the accepted answer points to the real problem there: PATH in Windows (Author uses windows environment). 'npx prisma generate' is simpler and cleaner. It will generate the executable in the local dev environment.Judaism
E
3

It isn't a problem with prisma, but with how you configured your PATH on Windows.

Windows doesn't know where is prisma, so you must tell him where to look.

See this answer to learn how to do that: Nodejs cannot find installed module on Windows?

Eloquent answered 24/1, 2019 at 10:4 Comment(0)
J
3

Assuming you have prisma installed in a local project:

npm i prisma @prisma/client
- or -
pnpm i prisma @prisma/client
- or -
yarn add prisma @prisma/client

Just call prisma generate like this (docs):

npx prisma generate
- or -
pnpm dlx prisma generate
- or -
yarn prisma

It works for all other node_modules using CLI as well (also in Windows).

Judaism answered 1/10, 2023 at 15:6 Comment(0)
C
-1

yarn add Prisma

please try this command

Carolanncarole answered 26/11, 2023 at 5:46 Comment(0)
I
-1

If you use bun, then type

  1. bunx prisma: npm is equivlant to bun and likewise npx is equivalent to bunx. You can also write bun x.
  2. then type bun prisma init (instead of just prisma init).
Ingvar answered 9/4 at 14:48 Comment(1)
Keep in mind that the question didn't ask about Bun or bunx, but specifically about Node/npm. If we simply posted new Bun answers on all of the old Node questions, then we'd have thousands of new answers that aren't needed. If you had a similar issue with Bun, then post a new question about it and self-answer. Thanks!Tolmann

© 2022 - 2024 — McMap. All rights reserved.