Oops! Something went wrong! :( ESLint couldn‘t find the plugin “eslint-plugin-@typescript-eslint“.

报错信息

Oops! Something went wrong! :(

ESLint couldn't find the plugin "eslint-plugin-@typescript-eslint". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-@typescript-eslint is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

经stackoverflow查询是eslint版本问题

  "@typescript-eslint/eslint-plugin": "^4.10.0",
  "@typescript-eslint/parser": "^4.10.0",
  "babel-eslint": "^10.1.0",
  "prettier": "^2.2.1",
  "husky": "^4.0.0",
  "lint-staged": "^10.0.0",
  "@ecomfe/eslint-config": "^4.0.0",
  "eslint": "^7.16.0",
  "eslint-config-prettier": "^7.1.0",
  "eslint-plugin-prettier": "^3.3.0",
  "eslint-plugin-babel": "^5.0.0",
  "commitizen": "^4.2.2",
  "validate-commit-msg": "^2.14.0"

然后运行有新的报错信息

node_modules/eslint/bin/eslint.js:93
        } catch {
                ^

SyntaxError: Unexpected token {

查了一下,应该是node版本的问题,我本地node8版本不支持这个语法,需要node10以上的,但是我node版本不能升级,这样影响面会比较大。

ESLint v7.0.0 发布:不再支持 Node.js v8
我们使用的eslint是"eslint": “^7.16.0”,

所以需要找eslint和node8版本适配的版本。

然后把eslint降到了 “eslint”: “^6.8.0”,

接着就运行又报错 "prettier"语法错误,然后又修改: “prettier”: "^1.19.1"为这个版本。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值