如何解决 Nextjs 上未找到 next-auth/client 模块的问题

sma*_*PYJ 5 reactjs next.js next-auth

我正在使用 Prisma 和 GitHub auth 开发一个 nextjs 项目,运行npm run dev项目后无法编译,如下图所示;

编译失败

我该如何解决这个问题?

下面的package.json

{
  "name": "hello-next",
  "version": "1.0.0",
  "description": "",
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  },
  "keywords": [],
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@prisma/client": "^3.6.0",
    "next": "^12.0.7",
    "next-auth": "^4.0.5",
    "react": "16.14.0",
    "react-dom": "16.14.0",
    "react-markdown": "5.0.2"
  },
  "devDependencies": {
    "@types/next-auth": "3.1.14",
    "@types/node": "14.14.6",
    "@types/react": "16.9.56",
    "prisma": "^3.6.0",
    "typescript": "4.5.4"
  }
}
Run Code Online (Sandbox Code Playgroud)

Sam*_* A. 13

next-auth/client 已重命名

  • 剧透:next-auth/react。(自动取款机) (2认同)