如何解决此错误:package.json » eslint-config-react-app/jest#overrides[0]: 环境键“jest/globals”未知

The*_*ofE 19 javascript build reactjs eslint yarnpkg

无法启动我的应用程序,sudo yarn build我收到此错误:

\n
package.json \xc2\xbb eslint-config-react-app/jest#overrides[0]:\n   Environment key "jest/globals" is unknown\n
Run Code Online (Sandbox Code Playgroud)\n

该错误的解决方案是什么?

\n

See*_*dav 19

更新 Package.json(从扩展数组中删除“react-app/jest”

"eslintConfig": { "extends": [ "react-app" ] },
Run Code Online (Sandbox Code Playgroud)

如果您使用 eslintconfig 删除它或从扩展数组中删除react-app/jest并仅保留react-app运行npm install并再次检查它应该可以工作。


小智 -1

这是由于 node_modules 中的错误 手动从文件目录中删除 node_modules 并尝试在 VSCode 终端中运行此代码:

npm install
Run Code Online (Sandbox Code Playgroud)

  • npm install 无法解决 (2认同)