【问题标题】:next-auth is not installing in my project(Nextjs, React)next-auth 没有安装在我的项目中(Nextjs,React)
【发布时间】: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


【解决方案1】:

从@pfcodes 得到它: 为安装和升级操作添加 --ignore-engines 标志以暂时解决这个问题。 here

【讨论】:

    猜你喜欢
    • 2021-10-27
    • 2022-07-22
    • 2021-08-06
    • 2022-01-22
    • 2021-10-20
    • 2020-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多