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

yarn build执行失败:无法加载jsx-a11y插件,寻求解决办法

解决ESLint加载jsx-a11y插件失败的问题

可行解决方案

1. 手动安装缺失的插件

eslint-config-next的依赖链可能未正确引入该插件,直接手动安装:

yarn add eslint-plugin-jsx-a11y --dev

2. 清理缓存后重装依赖

缓存或锁定文件异常可能导致依赖安装不完整,执行以下命令:

yarn cache clean
rm -rf node_modules yarn.lock
yarn install

3. 修正ESLint配置

打开.eslintrc.json,手动添加jsx-a11y插件到配置中,确保加载路径正确:

{
  "plugins": ["jsx-a11y"],
  "extends": [
    "next/core-web-vitals"
  ]
}

4. 降级eslint-config-next版本

当前14.0.3版本可能存在依赖兼容bug,尝试降级到前一个稳定版:

yarn add eslint-config-next@14.0.2 --dev

5. 检查Yarn版本兼容性

确保使用的Yarn版本为稳定分支(如Yarn 1.x或Yarn Berry稳定版),版本不匹配也可能引发依赖解析异常。

内容的提问来源于stack exchange,提问作者conchui

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.05 10:22:35