Skip to content

peer dependency confilct when creating projects using vue 2 on npm #7149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Gregory-Ledray opened this issue May 24, 2022 · 5 comments
Open

Comments

@Gregory-Ledray
Copy link

Version

4.5.15

Reproduction link

github.com

Environment info

Windows, new laptop & installation

Steps to reproduce

Run

vue create project_name

to create a vue project and then choose vue 2. Then

cd project_name && npm update

What is expected?

Dependencies updated

What is actually happening?

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   peer eslint@">= 4.12.1" from [email protected]
npm ERR!   node_modules/babel-eslint
npm ERR!     dev babel-eslint@"^10.1.0" from the root project
npm ERR!   peer eslint@">=5.0.0" from [email protected]
npm ERR!   node_modules/vue-eslint-parser
npm ERR!     vue-eslint-parser@"^7.0.0" from [email protected]
npm ERR!     node_modules/eslint-plugin-vue
npm ERR!       dev eslint-plugin-vue@"^6.2.2" from the root project
npm ERR!   1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">= 1.6.0 < 7.0.0" from @vue/[email protected]
npm ERR! node_modules/@vue/cli-plugin-eslint
npm ERR!   dev @vue/cli-plugin-eslint@"^4.5.15" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint
npm ERR!   peer eslint@">= 1.6.0 < 7.0.0" from @vue/[email protected]
npm ERR!   node_modules/@vue/cli-plugin-eslint
npm ERR!     dev @vue/cli-plugin-eslint@"^4.5.15" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\greg\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!

Opening because #6270 is closed and I can't re-open it.

Workaround is from: #6270 (comment)

npm update --legacy-peer-deps
npm audit fix --legacy-peer-deps
@awulkan
Copy link

awulkan commented Jun 22, 2022

I have the same issue. We can't even install or build our projects anymore.
The only workaround I've found is the one suggested above, but it feels dirty.

@Akuket
Copy link

Akuket commented Jul 1, 2022

Same problem here with initial install from vue-cli

Node => v16.15.1
Npm => 8.11.0
Vue-cli => 5.0.6

Generated package.json

{
  "name": "test",
  "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.8.3",
    "vue": "^2.6.14",
    "vue-router": "^3.5.1",
    "vuex": "^3.6.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.16",
    "@babel/eslint-parser": "^7.12.16",
    "@vue/cli-plugin-babel": "~5.0.0",
    "@vue/cli-plugin-eslint": "~5.0.0",
    "@vue/cli-plugin-router": "~5.0.0",
    "@vue/cli-plugin-vuex": "~5.0.0",
    "@vue/cli-service": "~5.0.0",
    "@vue/eslint-config-standard": "^6.1.0",
    "eslint": "^7.32.0",
    "eslint-plugin-import": "^2.25.3",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^5.1.0",
    "eslint-plugin-vue": "^8.0.3",
    "sass": "^1.32.7",
    "sass-loader": "^12.0.0",
    "vue-template-compiler": "^2.6.14"
  }
}

Hope it will help

@christian-reichart
Copy link

Create an .npmrc file on root with the content legacy-peer-deps=true

@mzm008
Copy link

mzm008 commented Nov 1, 2023

how to fix this issue?

@bheemireddinanibabu
Copy link

bheemireddinanibabu commented Nov 29, 2023

To solve this issue simply downgrade the version which is suggested by npm.

For eg. npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR! peer eslint@">= 4.12.1" from [email protected]
npm ERR! node_modules/babel-eslint
npm ERR! dev babel-eslint@"^10.1.0" from the root project
npm ERR! peer eslint@">=5.0.0" from [email protected]
npm ERR! node_modules/vue-eslint-parser
npm ERR! vue-eslint-parser@"^7.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-vue
npm ERR! dev eslint-plugin-vue@"^6.2.2" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">= 1.6.0 < 7.0.0" from @vue/[email protected]
npm ERR! node_modules/@vue/cli-plugin-eslint
npm ERR! dev @vue/cli-plugin-eslint@"^4.5.15" from the root project

Here it is saying

Could not resolve dependency:
npm ERR! peer eslint@">= 1.6.0 < 7.0.0" from @vue/[email protected]

So please update eslint version between >= 1.6.0 < 7.0.0 in package.json file and then run command npm install
If you get any error related to resolving dependency. Please follow this

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants