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?
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?
Share Improve this question edited May 1, 2021 at 9:03 jonrsharpe 122k30 gold badges266 silver badges473 bronze badges asked May 1, 2021 at 7:17 ThePowerofEThePowerofE 2311 gold badge2 silver badges3 bronze badges 2- What should come from npmjs.com/package/eslint-plugin-jest, but I'm without a minimal reproducible example it's hard to say why your specific setup doesn't work. – jonrsharpe Commented May 1, 2021 at 7:19
- 1 As a temporary solution you could remove "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, from your package.json – Neri Barakat Commented May 8, 2021 at 0:41
5 Answers
Reset to default 21Update 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.
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.
That didn't work for me. The reason the error came up is because I had the same value in my CSS file for a media query as in my inline styling.
I was trying to set the font-size to 18px in the media query for mobile development and it was the same value in my inline styling. When I changed the values so that they were not the same the error went away.
If you don't want to remove "react-app/jest"
from "eslintConfig"
, try installing the following node module, it worked for me.
npm install eslint-plugin-jsx-a11y
Related question and answer: https://stackoverflow.com/a/76461213/7034385
This is due to error in node_modules Delete node_modules from file directory manually and try running this code in terminal of VSCode :
npm install