Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve this error: package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown

Unable to launch my app using sudo yarn build I am getting this error:

package.json » eslint-config-react-app/jest#overrides[0]:
   Environment key "jest/globals" is unknown

What would be a solution for this error?

like image 936
ThePowerofE Avatar asked May 01 '21 07:05

ThePowerofE


2 Answers

Update Package.json(Remove "react-app/jest" from extends array

"eslintConfig": { "extends": [ "react-app" ] },

if you are using eslintconfig delete that or remove the react-app/jest from there extends array and keep only react-app Run npm install and check again It should work.

like image 130
Seeta Ram Yadav Avatar answered Oct 06 '22 01:10

Seeta Ram Yadav


I had the same issue with npm.

Resolution took editing package.json

Find and remove the whole eslintConfig

"eslintConfig": {
  "extends": [
      "react-app",
      "react-app/jest"
  ]
},

also I had devDependencies that needed to be removed.

  "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"
  }

I ran "npm install". The error cleared. Then I added all of the above back into the package.json. I ran "npm install" again with no errors.

like image 41
Daniel Lord Avatar answered Oct 06 '22 01:10

Daniel Lord