【发布时间】:2022-12-25 19:31:46
【问题描述】:
我在反应项目中为我的 nextjs 使用 yarn create next-app。但是 next-auth 不是 安装在我的项目中。我的节点版本是 LTS 16.15.1 yarn 版本是 1.22.18,npm 版本是 8.9.0。我试过最新版本和旧版本 nodejs 的版本,但我一次又一次地收到这个错误。请解决我的问题 如何在我的项目中安装 next-auth。
yarn add v1.22.18
warning ../../../package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
error next-auth@4.3.4: The engine "node" is incompatible with this module.
Expected version "^12.19.0 || ^14.15.0 || ^16.13.0". Got "18.2.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this
command.
【问题讨论】:
-
从报错可以看出
next-auth只兼容以下Node.js版本范围^12.19.0 || ^14.15.0 || ^16.13.0,与你本地的Node.js版本18.2.0不匹配。确保您使用的是兼容版本。
标签: javascript reactjs next.js