![](/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.