Simbarashe Mutasa
Simbarashe Mutasa

Reputation: 41

Failed to load plugin 'vue' declared in 'package.json'

Failed to load plugin 'vue' declared in 'package.json': Package subpath './lib/rules/array-bracket-spacing' is not defined by "exports" in C:\Users\<my_username>\FolderX\Subfolder\<appname>\eslint\package.json
Referenced from: C:\Users\<my_username>\FolderX\Subfolder\<appname>\package.json

That's the error I'm getting every time I npm run serve I've upated eslint, added prettier and fixed most of my vulnerability problems, and it still persists. I've combed the eslint issues on github and there is nothing like this, some issues are similar but they refer to eslintrc. Nothing is matching this exactly. I should mention that the app itself is very small and simple. It was supposed to be the start of a project but when I was adding views to the project, this happened.

package.json

  "name": "online-birth-registration-system",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.6.5",
    "vue": "^2.6.11",
    "vue-router": "^4.0.14"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^5.0.3",
    "@vue/cli-plugin-eslint": "^5.0.1",
    "@vue/cli-service": "^5.0.3",
    "babel-eslint": "^10.1.0",
    "eslint": "^8.11.0",
    "eslint-plugin-vue": "^6.2.2",
    "prettier-eslint": "^13.0.0",
    "vue-template-compiler": "^2.6.11"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

Any help would be greatly appreciated.

Upvotes: 4

Views: 6311

Answers (3)

Yu Cong
Yu Cong

Reputation: 1

There may be a problem with the version of the eslint-plugin-vue package that you have installed. Make sure that you are using a compatible version of the plugin with the version of ESLint that you are using. You can check the version of ESLint by running the following command:

npm list --depth=0 eslint

Then choose the correct version of eslint和eslint-plugin-vue!!!

Upvotes: 0

Upgraded eslint-plugin-vue to 9.1.1

Solved it for me

Upvotes: 3

susan_saranwrap
susan_saranwrap

Reputation: 61

I ran into the same issue with array-bracket-spacing and was able to fix it by downgrading eslint in my package.json from "^8.6.0" to "^7.32.0". None of the other suggested fixes worked for me either

Upvotes: 6

Related Questions