2

Given the following package.json, I see warnings when running yarn install:

warning " > @vue/cli-plugin-eslint@4.5.13" has incorrect peer dependency "eslint@>= 1.6.0 < 7.0.0".
warning "@vue/cli-plugin-eslint > eslint-loader@2.2.1" has incorrect peer dependency "eslint@>=1.6.0 <7.0.0".
warning " > vue-jest@3.0.7" has unmet peer dependency "babel-core@^6.25.0 || ^7.0.0-0".
warning " > sass-loader@10.2.0" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".

I added the peerDependencies to package.json but the warnings still appear.

  "peerDependencies": {
    "babel-core": "^7.0.0-0",
    "eslint": "^6.8.0",
    "webpack": "^5.0.0"
  }

Am I missing something here to resolve those warnings?

package.json

{
  "name": "my-project",
  "scripts": {
    "serve": "./node_modules/.bin/vue-cli-service serve",
    "build": "./node_modules/.bin/vue-cli-service build",
    "lint": "./node_modules/.bin/vue-cli-service lint"
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-brands-svg-icons": "^5.15.4",
    "@fortawesome/free-regular-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/vue-fontawesome": "^2.0.2",
    "@popperjs/core": "^2.9.3",
    "@websanova/vue-auth": "^4.1.4",
    "axios": "^0.21.1",
    "bootstrap-vue": "^2.21.2",
    "core-js": "^3.16.4",
    "date-fns": "^2.23.0",
    "date-input-polyfill": "^2.14.0",
    "intersection-observer": "^0.12.0",
    "lodash": "^4.17.21",
    "nprogress": "^0.2.0",
    "portal-vue": "^2.1.7",
    "sanitize-html": "^2.4.0",
    "vue": "^2.6.14",
    "vue-currency-filter": "^5.2.0",
    "vue-i18n": "^8.25.0",
    "vue-lodash": "^2.1.2",
    "vue-morphling": "^1.1.2",
    "vue-multiselect": "^2.1.6",
    "vue-notification": "^1.3.20",
    "vue-observe-visibility": "^1.0.0",
    "vue-recaptcha": "^1.3.0",
    "vue-resource": "^1.5.3",
    "vue-router": "^3.5.2",
    "vue-scrollto": "^2.20.0",
    "vue-step-indicator": "^0.1.2",
    "vue-transmit": "^8.1.4",
    "vuejs-dialog": "^1.4.2",
    "vuejs-logger": "^1.5.5",
    "vuelidate": "^0.7.6",
    "vuex": "^3.6.2",
    "vuex-map-fields": "^1.4.1",
    "yn": "^5.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.15.0",
    "@types/jest": "^27.0.1",
    "@vue/cli-plugin-babel": "~4.5.13",
    "@vue/cli-plugin-eslint": "~4.5.13",
    "@vue/cli-plugin-unit-jest": "~4.5.13",
    "@vue/cli-service": "~4.5.13",
    "@vue/eslint-config-prettier": "^6.0.0",
    "@vue/test-utils": "^1.2.2",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^27.1.0",
    "eslint": "^7.32.0",
    "eslint-plugin-prettier": "^3.4.1",
    "eslint-plugin-vue": "^7.17.0",
    "json-to-properties": "^1.1.3",
    "node-sass": "^6.0.1",
    "prettier": "^2.3.2",
    "pug": "^3.0.2",
    "pug-plain-loader": "^1.1.0",
    "sass-loader": "^10.2.0",
    "vue-jest": "^3.0.7",
    "vue-resource-mocker": "^1.0.3",
    "vue-template-compiler": "^2.6.14"
  },
  "peerDependencies": {
    "babel-core": "^7.0.0-0",
    "eslint": "^6.8.0",
    "webpack": "^5.0.0"
  }
}
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Robert Strauch
  • 12,055
  • 24
  • 120
  • 192
  • When you say you added them to peerDependencies, did you just edit the package file? Because they also need to be _actually installed_. They also need to match what's required - your devDependencies installation of ESLint is v7, for example, which isn't covered in what the message is telling you is required. Unless you're making a library you expect other people to consume, you don't actually have any peer deps. – jonrsharpe Aug 30 '21 at 09:54
  • @jonrsharpe I added them by using `yarn add --peer `. – Robert Strauch Aug 30 '21 at 10:20
  • 2
    When it says peer deps are missing it doesn't mean you have to add them as peer deps - again, that's only relevant when you're publishing a package (see e.g. https://classic.yarnpkg.com/en/docs/dependency-types#toc-peer-dependencies). It means you were expected to already have them as dev or regular dependencies to use the packages you're installing - Vue's ESLint CLI plugin isn't much use without a compatible ESLint, for example. Read e.g. https://stackoverflow.com/q/46928390/3001761, https://stackoverflow.com/q/42361942/3001761 – jonrsharpe Aug 30 '21 at 10:26
  • I'd say it's a bug. It just started showing on my project, inexplicably after working until now. – Craig Hicks Jan 09 '22 at 09:32

0 Answers0