Ezatla
Ezatla

Reputation: 195

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

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

Upvotes: 16

Views: 25662

Answers (5)

REZWAN FAYSAL REZON
REZWAN FAYSAL REZON

Reputation: 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).

Upvotes: -1

ISK
ISK

Reputation: 99

yarn add Prisma

please try this command

Upvotes: -2

radzi0_0
radzi0_0

Reputation: 1387

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).

Upvotes: 6

Akhigbe-E
Akhigbe-E

Reputation: 287

Install it globally with; npm i -g prisma

Upvotes: 23

Errorname
Errorname

Reputation: 2459

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?

Upvotes: 5

Related Questions