Skip to main content

系统要求

本页概述了 Prisma ORM 的系统要求。

¥This page provides an overview of the system requirements for Prisma ORM.

系统要求

¥System requirements

本部分列出了 Prisma ORM 所需的软件和支持的操作系统,以及特定操作系统的运行时依赖要求。

¥This section lists the software that Prisma ORM requires and the supported operating systems, along with runtime dependency requirements for specific operating systems.

软件要求

¥Software requirements

最新版本的 Prisma ORM 需要以下软件:

¥The latest version of Prisma ORM requires the following software:

工具所需的最低版本
Node.js18.8 / 20.9 / 22.11
TypeScript(可选)5.1.X
Yarn(可选)1.19.2

也可以看看:支持的数据库版本

¥See also: Supported database versions

Expand for earlier versions

Prisma ORM v5

Prisma ORM v5 需要以下软件:

¥Prisma ORM v5 requires the following software:

所需的最低版本
Node.js16.13 / 18.X / 20.X
TypeScript(可选)4.7.X
Yarn(可选)1.19.2

操作系统

¥Operating systems

Prisma ORM 在 macOS、Windows 和大多数 Linux 发行版上均受支持。

¥Prisma ORM is supported on macOS, Windows and most Linux distributions.

Linux 运行时依赖

¥Linux runtime dependencies

Prisma ORM 需要安装以下系统库才能工作:

¥Prisma ORM requires the following system libraries to be installed to work:

  • OpenSSL 1.0.x、1.1.x 或 3.x

    ¥OpenSSL 1.0.x, 1.1.x or 3.x

  • 兹库 (libz.so.1)

    ¥zlib (libz.so.1)

  • libgcc (libgcc_s.so.1)

  • C 标准库(大多数 Linux 发行版上的 glibc 或 Alpine Linux 上的 musl libc)

    ¥C standard library (glibc on most Linux distributions or musl libc on Alpine Linux)

以下两个表显示了每个 CPU 架构支持的 Linux 发行版系列、OpenSSL 版本和 C 标准库。

¥The following two tables show the supported Linux distro families, OpenSSL versions and C standard libraries for each CPU architecture.

AMD64x86_64)架构上:

¥On AMD64 (x86_64) architecture:

发行版家族OpenSSL 版本libc 版本
Alpine1.1.x、3.x穆斯尔 1.2.x
RHEL1.0.x、1.1.x、3.xglibc 2.17+
Debian 或其他1.0.xglibc 2.19+
Debian 或其他1.1.x、3.xglibc 2.24+

ARM64aarch64)架构上:

¥On ARM64 (aarch64) architecture:

发行版家族OpenSSL 版本libc 版本
Alpine1.1.x、3.x穆斯尔 1.2.x
RHEL1.0.x、1.1.x、3.xglibc 2.24+
Debian 或其他1.0.x、1.1.x、3.xglibc 2.24+

当 Prisma ORM 无法解析系统上的 OpenSSL 版本时(例如,因为未安装),它将默认为 OpenSSL 1.1.x。

¥When Prisma ORM can not resolve the OpenSSL version on a system (e.g. because it is not installed), it will default to OpenSSL 1.1.x.

可以运行受支持的 Node.js 版本的系统很可能具有可用的 zlib 和 libgcc。一个值得注意的例外是 Google 的 Distroless 映像,其中 libz.so.1 需要从兼容的 Debian 系统复制。

¥Systems that can run the supported Node.js versions will most likely have zlib and libgcc available. One notable exception is Google's Distroless images, where libz.so.1 needs to be copied from a compatible Debian system.

Windows 运行时依赖

¥Windows runtime dependencies

在 Windows Microsoft Visual C++ 可再发行组件 2015 或更高版本上,必须安装(大多数现代安装的默认情况都是如此)。

¥On Windows Microsoft Visual C++ Redistributable 2015 or newer must be installed (which is by default the case on most modern installations).

macOS 运行时依赖

¥macOS runtime dependencies

Prisma ORM 支持 macOS 10.15 或更高版本。除了 软件要求 部分中为所有平台列出的要求之外,macOS 上没有其他特定于平台的要求。

¥Prisma ORM supports macOS 10.15 or newer. There are no additional platform-specific requirements on macOS other than what is listed for all platforms in the Software requirements section.

故障排除

¥Troubleshooting

使用过时的系统要求版本会导致一些常见问题:

¥There are some common problems caused by using outdated versions of the system requirements:

无法使用 @prisma/client 构建 TypeScript 项目

¥Unable to build a TypeScript project with @prisma/client

问题

¥Problem

当你在运行 prisma generate 后尝试对项目进行类型检查时,你会看到以下错误。

¥You see the following error when you try type-checking a project after you run prisma generate.

./node_modules/.prisma/client/index.d.ts:10:33
Type error: Type expected.
8 | export type PrismaPromise<A> = Promise<A> & {[prisma]: true}
9 | type UnwrapTuple<Tuple extends readonly unknown[]> = {
> 10 | [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise<infer X> ? X : never : never
| ^
11 | };
12 |
13 |

解决方案

¥Solution

将项目中的 TypeScript 依赖升级到 Prisma ORM 支持的版本npm install -D typescript

¥Upgrade the TypeScript dependency in your project to a version supported by Prisma ORM. npm install -D typescript.

无法使用 groupBy 预览功能

¥Unable to use groupBy preview feature

问题

¥Problem

当你尝试运行使用 groupBy 预览功能的应用时,你会看到以下控制台错误:

¥You see the following console error when you attempt to run an app that uses the groupBy preview feature:

server.ts:6:25 - error TS2615: Type of property 'OR' circularly references itself in mapped type '{ [K in keyof { AND?: Enumerable<ProductScalarWhereWithAggregatesInput>; OR?: Enumerable<ProductScalarWhereWithAggregatesInput>; ... 4 more ...; category?: string | StringWithAggregatesFilter; }]: Or<...> extends 1 ? { ...; }[K] extends infer TK ? GetHavingFields<...> : never : {} extends FieldPaths<...> ? never : K...'.
6 const grouped = await prisma.product.groupBy({
~~~~~~~~~~~~~~~~~~~~~~~~
7 by: ['category']
~~~~~~~~~~~~~~~~~~~~
8 });
~~~~
server.ts:6:48 - error TS2554: Expected 0 arguments, but got 1.
6 const grouped = await prisma.product.groupBy({
~
7 by: ['category']
~~~~~~~~~~~~~~~~~~~~
8 });
~~~

解决方案

¥Solution

将项目中的 TypeScript 依赖升级到 Prisma ORM 支持的版本npm install -D typescript

¥Upgrade the TypeScript dependency in your project to a version supported by Prisma ORM. npm install -D typescript.