Reputation: 195
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.
Upvotes: 16
Views: 25662
Reputation: 1
If you use bun, then type
bunx prisma
: npm
is equivlant to bun
and likewise npx
is equivalent to bunx
. You can also write bun x
.bun prisma init
(instead of just prisma init
).Upvotes: -1
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
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