![](/img/trans.png)
[英]Failed to load plugin 'jest' declared in 'package.json » eslint-config-react-app/jest': Cannot read properties of undefined (reading 'meta')
[英]How to solve this error: package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown
无法使用sudo yarn build
启动我的应用程序我收到此错误:
package.json » eslint-config-react-app/jest#overrides[0]:
Environment key "jest/globals" is unknown
这个错误的解决方案是什么?
这是由于 node_modules 中的错误手动从文件目录中删除 node_modules 并尝试在 VSCode 的终端中运行此代码:
npm install
更新 Package.json(从扩展数组中删除“react-app/jest”
"eslintConfig": { "extends": [ "react-app" ] },
如果您正在使用 eslintconfig 删除它或从那里删除 react-app/jest 扩展数组并仅保留 react-app 运行 npm 安装并再次检查 它可以工作 它应该可以工作。
我对 npm 也有同样的问题。
分辨率带编辑 package.json
查找并删除整个 eslintConfig
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
我也有需要删除的 devDependencies。
"devDependencies": {
"eslint": "7.30.0",
"eslint-config-airbnb": "18.2.1",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-react": "7.24.0",
"eslint-plugin-react-hooks": "4.2.0",
"prettier": "2.3.2"
}
我跑了“npm install”。 错误清除。 然后我将以上所有内容添加回 package.json。 我再次运行“npm install”,没有任何错误。
npm 安装——帮我解决了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.