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

加载jsx-a11y插件失败报错求助:关联eslint-config-react-app

解决"Failed to load plugin 'jsx-a11y' declared in 'package.json → eslint-config-react-app': Unexpected token ="报错的思路
  • 清理依赖缓存并重装

    • 删除node_modules文件夹:rm -rf node_modules(Windows系统用rmdir /s /q node_modules)
    • 删除包管理锁文件:rm package-lock.json yarn.lock(根据你使用的npm/yarn选择对应命令)
    • 重新安装依赖:npm install 或 yarn install
  • 检查ESLint相关依赖版本兼容性

    • 查看当前依赖版本:npm list eslint eslint-plugin-jsx-a11y eslint-config-react-app
    • 若版本不匹配,手动锁定兼容版本,比如在package.json中指定eslint-plugin-jsx-a11y为6.7.1,再执行依赖重装
  • 临时禁用jsx-a11y插件定位问题

    • 修改eslint配置:
      "eslintConfig": {
        "extends": [
          "react-app",
          "react-app/jest"
        ],
        "plugins": ["!jsx-a11y"]
      },
      
    • 重新编译,若恢复正常,可确定是该插件的版本或兼容性问题,再针对性调整
  • 调整react-scripts版本

    • 报错多因react-scripts与ESLint生态版本不兼容导致,尝试升级到最新版:npm install react-scripts@latest,或降级到之前正常工作的版本(如npm install react-scripts@5.0.1)

内容的提问来源于stack exchange,提问作者Footprint on Earth

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.09 23:50:30