You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

新建集成NextAuth与Prisma的Next.js应用抛出"TypeError: Cannot read properties of undefined (reading 'exec')"错误求助

新建集成NextAuth与Prisma的Next.js应用抛出"TypeError: Cannot read properties of undefined (reading 'exec')"错误求助

我刚启动了一个新项目,用create-next-app@latest初始化,按照最新文档安装了Prisma、NextAuth以及对应的Prisma适配器。数据库配置已经验证没问题,Next.js的密钥也设置好了,middleware.ts、auth.ts和prisma.ts都是直接从官方文档复制的,Google OAuth的凭据也配置正确,但现在遇到了下面的运行时错误:

Runtime Error


TypeError: Cannot read properties of undefined (reading 'exec')

Call Stack
10

Hide 10 ignore-listed frame(s)
[project]/node_modules/@prisma/client/runtime/library.js [middleware-edge] (ecmascript)
node_modules/@prisma/client/runtime/library.js (4:6678)
<unknown>
[turbopack]/browser/runtime/base/dev-base.ts (205:21)
runModuleExecutionHooks
[turbopack]/browser/runtime/base/dev-base.ts (265:5)
instantiateModule
[turbopack]/browser/runtime/base/dev-base.ts (203:5)
getOrInstantiateModuleFromParent
[turbopack]/browser/runtime/base/dev-base.ts (132:10)
esmImport
[turbopack]/shared/runtime-utils.ts (214:18)
[project]/node_modules/@auth/prisma-adapter/index.js [middleware-edge] (ecmascript)
node_modules/@auth/prisma-adapter/index.js (1:1)
<unknown>
[turbopack]/browser/runtime/base/dev-base.ts (205:21)
runModuleExecutionHooks
[turbopack]/browser/runtime/base/dev-base.ts (265:5)
instantiateModule
[turbopack]/browser/runtime/base/dev-base.ts (203:5)

当前项目的依赖列表如下:

"dependencies": {
    "@auth/prisma-adapter": "^2.8.0",
    "@prisma/client": "^6.5.0",
    "next": "^15.2.2",
    "next-auth": "^5.0.0-beta.25",
    "react": "^19",
    "react-dom": "^19"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "15.2.2",
    "prisma": "^6.5.0",
    "typescript": "^5"
  }

我已经折腾好一阵了:查了各种资料,和Cursor聊过,改了不少配置,删除过node_modules重新安装,也重新生成过Prisma Client,但都没解决问题,有没有大佬能帮忙排查下原因?

备注:内容来源于stack exchange,提问作者cody blanchard

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 19:09:54