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

运行next lint提示无法加载next/core-web-vitals配置的修复请求

修复Next.js lint报错:Failed to load config "next/core-web-vitals"

报错信息

Failed to load config "next/core-web-vitals" to extend from.
Referenced from: /Users/filiptaticek/Desktop/.eslintrc.json

修复思路

  • 清理配置文件冲突:项目目录下同时存在.eslintrc.json和.eslintrc.js,ESLint加载时会出现优先级混淆,直接删掉其中一个(建议保留.eslintrc.json,确保内容为{"extends": "next/core-web-vitals"})。
  • 排查全局隐藏配置:终端执行ls -la /Users/filiptaticek/Desktop/,查看桌面是否存在隐藏的.eslintrc.json文件(以.开头的文件默认隐藏),如果有直接删除或重命名,避免全局配置干扰项目。
  • 重装依赖:删除项目根目录的node_modules文件夹、package-lock.json(或yarn.lock/pnpm-lock.yaml),然后执行npm install,确保eslint-config-next插件完整安装。
  • 匹配版本兼容性:检查package.json中eslint和eslint-config-next的版本是否匹配Next.js版本,执行npm list eslint eslint-config-next查看版本,若不兼容,执行npm install eslint-config-next@latest升级到对应版本。
  • 清除ESLint缓存:执行npx eslint --clear-cache,清除ESLint缓存文件,解决缓存导致的配置加载异常。
  • 强制指定配置文件:运行lint时直接指定项目内的配置文件,命令为npx eslint . --config ./eslintrc.json,强制ESLint使用项目本地配置,绕过全局配置影响。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.15 21:40:33