eslint报错,别慌: Failed to load plugin ‘@typescript-eslint/eslint-plugin‘ declared in ‘.eslintrc.js
标志安装所需的依赖项。未正确加载,问题可能与插件或 ESLint 配置的过时或不兼容版本有关。要绕过冲突的对等依赖项检查,可以使用。3.注意安装过程中是否存在漏洞。2.重新运行检查是否存在冲突。
·
遇到的错误表明插件 @typescript-eslint/eslint-plugin 未正确加载,问题可能与插件或 ESLint 配置的过时或不兼容版本有关。
1. 确保正确安装依赖项
npm
npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev
yarn
yarn add @typescript-eslint/eslint-plugin @typescript-eslint/parser --dev
2.重新运行检查是否存在冲突
要绕过冲突的对等依赖项检查,可以使用 --legacy-peer-deps 标志安装所需的依赖项。此标志将允许 npm 安装依赖项,而不管对等冲突如何:
npm install @typescript-eslint/eslint-plugin@5.0.0 @typescript-eslint/parser@5.0.0 --save-dev --legacy-peer-deps
3.注意安装过程中是否存在漏洞
存在漏洞修复:
npm audit fix --force
按上述即可修复!
更多推荐



所有评论(0)