react构建项目后start失败:Error while loading rule 'jsx-a11y/alt-text'

今天学了一天react,构建过很多次项目,结果晚上六点多用creat-react-app 创建的项目却无法start了,提示如下:
react构建项目后start失败:Error while loading rule 'jsx-a11y/alt-text'
对比了一下 各个文件,应该是package-lock.json文件里的版本什么的有变化了。
然后找这个jsx-a11y有什么变化,发现版本变了
将配置从

"eslint-plugin-jsx-a11y": {
    "version": "6.5.0",
    "resolved": "http://registry.npm.baidu-int.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.5.0.tgz",
    "integrity": "sha1-KRaAgxzvYKy85Rq4Hmbbygsqs9Q=",
    "requires": {
    "@babel/runtime": "^7.16.3",
    "aria-query": "^4.2.2",
    "array-includes": "^3.1.4",
    "ast-types-flow": "^0.0.7",
    "axe-core": "^4.3.5",
    "axobject-query": "^2.2.0",
    "damerau-levenshtein": "^1.0.7",
    "emoji-regex": "^9.2.2",
    "has": "^1.0.3",
    "jsx-ast-utils": "^3.2.1",
    "language-tags": "^1.0.5",
    "minimatch": "^3.0.4"
},

改为

"eslint-plugin-jsx-a11y": {
    "version": "6.4.1",
    "resolved": "http://registry.npm.baidu-int.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz",
    "integrity": "sha1-othMqkl1aUL0Lx/6uQAkNjkXGP0=",
    "requires": {
    "@babel/runtime": "^7.11.2",
    "aria-query": "^4.2.2",
    "array-includes": "^3.1.1",
    "ast-types-flow": "^0.0.7",
    "axe-core": "^4.0.2",
    "axobject-query": "^2.2.0",
    "damerau-levenshtein": "^1.0.6",
    "emoji-regex": "^9.0.0",
    "has": "^1.0.3",
    "jsx-ast-utils": "^3.1.0",
    "language-tags": "^1.0.5"
},

再重新 npm install 一下,就又能成功start了

上一篇:页面 loading 实现


下一篇:美食杰,菜谱大全,loading事件和对应内容显示实现效果(四)