create-react-app 无法加载插件 '@typescript-eslint',找不到模块 'eslint/use-at-your-own-risk'

wqsoz72f  于 2个月前  发布在  React
关注(0)|答案(5)|浏览(41)

npm start 报告了以下错误
在 'package.json » eslint-config-react-app#overrides[0]' 中声明的 '@typescript-eslint' 插件加载失败:找不到模块 'eslint/use-at-your-own-risk'
Require stack:

  • /Users/jasonli/web/专项训练营/datav/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.js
  • /Users/jasonli/web/专项训练营/datav/node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js
  • /Users/jasonli/web/专项训练营/datav/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js
  • /Users/jasonli/web/专项训练营/datav/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
  • /Users/jasonli/web/专项训练营/datav/node_modules/@eslint/eslintrc/dist/eslintrc.cjs

macOS 12.2.1
node v15.14.0
create-react-app v15.0.1

gkl3eglg

gkl3eglg2#

这是因为eslint尚未升级到版本8。

uxhixvfz

uxhixvfz3#

这可能是由于您正在运行的节点版本所致。例如,当我在12.6.0上运行项目时,我会遇到这个问题,但当我使用版本14.16.0时,我没有问题。

lawou6xi

lawou6xi4#

当我编辑WebWorkers时,我遇到了这个错误:

new Worker(
    /* webpackChunkName: "block-parser-worker" */ new URL('web-workers/blockParserWorker.js', import.meta.url)
  );

node v16.17.2
react-scripts: 5.0.1

cgyqldqp

cgyqldqp5#

相同的问题
ESLint: 8.22.0
错误:无法加载在'.eslintrc.js » eslint-config-airbnb-typescript » /node_modules/eslint-config-airbnb-typescript/lib/shared.js'中声明的插件'@typescript-eslint':找不到模块'eslint/use-at-your-own-risk'
Node v14.20.0

"@typescript-eslint/eslint-plugin": "^5.33.1",
    "@typescript-eslint/parser": "^5.33.1",
    "eslint": "^8.22.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-airbnb-typescript": "^17.0.0",
    "eslint-import-resolver-typescript": "^3.5.0",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-jsx-a11y": "^6.6.1",
    "eslint-plugin-react": "^7.30.1",
    "eslint-plugin-react-hooks": "^4.6.0",

相关问题