question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

peer dependency confilct when creating projects using vue 2 on npm 7

See original GitHub issue

Version

4.5.11

Environment info

 System:
    OS: Linux 5.4 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 12.17.0 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 7.5.2 - ~/npm-global/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1
    @vue/babel-helper-vue-transform-on:  1.0.2
    @vue/babel-plugin-jsx:  1.0.3
    @vue/babel-plugin-transform-vue-jsx:  1.2.1
    @vue/babel-preset-app:  4.5.11
    @vue/babel-preset-jsx:  1.2.4
    @vue/babel-sugar-composition-api-inject-h:  1.2.1
    @vue/babel-sugar-composition-api-render-instance:  1.2.4
    @vue/babel-sugar-functional-vue:  1.2.2
    @vue/babel-sugar-inject-h:  1.2.2
    @vue/babel-sugar-v-model:  1.2.3
    @vue/babel-sugar-v-on:  1.2.3
    @vue/cli-overlay:  4.5.11
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.11
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.11
    @vue/cli-plugin-router:  4.5.11
    @vue/cli-plugin-vuex:  4.5.11
    @vue/cli-service: ~4.5.0 => 4.5.11
    @vue/cli-shared-utils:  4.5.11
    @vue/component-compiler-utils:  3.2.0
    @vue/preload-webpack-plugin:  1.1.2
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^6.2.2 => 6.2.2
    vue: ^2.6.11 => 2.6.12
    vue-eslint-parser:  7.4.1
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.9.6 (16.1.2)
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.11 => 2.6.12
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: 4.5.11

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?

receive an error says “ERESOLVE unable to resolve dependency tree”

Detail:

$ npm update         
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: project_name@0.1.0
npm ERR! Found: vue@2.6.12
npm ERR! node_modules/vue
npm ERR!   vue@"^2.6.11" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"3.0.5" from @vue/compiler-sfc@3.0.5
npm ERR! node_modules/@vue/compiler-sfc
npm ERR!   peerOptional @vue/compiler-sfc@"^3.0.0-beta.14" from @vue/cli-service@4.5.11
npm ERR!   node_modules/@vue/cli-service
npm ERR!     dev @vue/cli-service@"~4.5.0" from the root project
npm ERR!     1 more (@vue/cli-plugin-babel)
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.

peerDependenciesMeta used in @vue/cli-service causes unexpected behavior on npm 7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:46
  • Comments:32 (3 by maintainers)

github_iconTop GitHub Comments

62reactions
foxtedcommented, Feb 10, 2021

npm i --legacy-peer-deps fixed it for me

12reactions
NathanAPcommented, Nov 9, 2021

I’m sorry, but why is this issue closed? It is NOT resolved. I just created a new project with VueCli and I can’t run npm audit fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM: npm peer dependency conflict - vue.js - Stack Overflow
this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Read more >
[Solved]-NPM: npm peer dependency conflict-Vue.js
What fixed this issue for me was simply removing the node_modules folder and then pasting the package versions in the package json file...
Read more >
Migrate from v4 - Vue CLI
For Vue 2 projects, @vue/vue2-jest is now required as a peer dependency, please install @vue/vue2-jest as a dev dependency to the project. For ......
Read more >
conflicting peer dependency: vue@2.7.10 - You.com
You are using npm 7.x, which is more strict about peer dependencies than npm 6.x. The easiest solution is to run npm install...
Read more >
vue - npm
The progressive JavaScript framework for building modern web UI.. Latest version: 3.2.45, last published: 2 months ago. Start using vue in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found