我在运行 Prisma Studio 时收到 Prisma Client 已弃用的消息。

huangapple go评论64阅读模式
英文:

I get prisma client deprecated on running prisma studio

问题

每次我运行`npx prisma studio`命令,我都会得到以下输出:

从.env加载环境变量
从prisma\schema.prisma加载Prisma模式
Prisma Studio已启动,位于http://localhost:5555
从"@prisma/client/runtime"导入的内容已被弃用。
请使用"@prisma/client/runtime/library"、"@prisma/client/runtime/data-proxy"或"@prisma/client/runtime/binary"。


我在他们的文档中没有找到如何修复此问题的信息。而且在删除了yarn.lock文件并运行yarn命令来安装package.json中的依赖项之后出现了这个问题。我尝试重新启动服务器,甚至重新启动了系统。
英文:

Any time I run the npx prisma studio command I get this output:

Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Prisma Studio is up on http://localhost:5555
imports from "@prisma/client/runtime" are deprecated.
Use "@prisma/client/runtime/library",  "@prisma/client/runtime/data-proxy" or  "@prisma/client/runtime/binary"

And I've not found anything on their documentation that says how to fix it. Also this happened after I deleted my yarn.lock file and did the yarn command to install dependencies in my package.json.

I tried restarting the server, even restarting my system

答案1

得分: 1

如果您曾经使用 Prisma 4.9.x,然后升级到 4.10.1,请尝试再次运行 npx prisma generate,此错误可能在此之后得以解决。

如果这没有帮助,请尝试使用以下命令启动 Prisma Studio:
dotenv -e .envrc -- prisma studio --browser=none

英文:

If you were using prisma 4.9.x and then upgraded to 4.10.1 try to invoke again npx prisma generate, the error will likely be resolved after this

If it doesn't help try to start prisma studio using this command

dotenv -e .envrc -- prisma studio --browser=none

huangapple
  • 本文由 发表于 2023年2月18日 14:14:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/75491558.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定