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 Dep Missing Error When use "npm list -g"

See original GitHub issue

Version

4.5.7

Environment info

Environment Info:

  System:
    OS: Windows 10 10.0.20221
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  Binaries:
    Node: 12.18.1 - D:\Installation\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.14.8 - D:\Installation\nodejs\npm.CMD
  Browsers:
    Chrome: 86.0.4240.75
    Edge: Spartan (44.20221.1000.0), Chromium (85.0.564.70)
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

When I use “npm list -g --depth 0”, @vue/cli throws a peer dep missing error just like this.

And I find that when I install @vue/cli, cli also returns a “@vue/compiler-sfc@3.0.0 requires a peer of vue@3.0.0 but none is installed” warning.

I don’t think this is a coincidence, as I have found that quite a few members of our team have the phenomenon.

What is expected?

Run Successful

What is actually happening?

Throw Error

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
sodateacommented, Oct 10, 2020

NPM incorrectly hoisted the dependencies from vue-codemod, putting vue@3 & @vue/compiler-sfc at different levels of the dependency tree, thus the warning. We’ll try to find a workaround.

1reaction
jcvw75commented, Nov 5, 2020

I found the issue. You need to use latest nodejs (15.0.1) and npm. (7.0.3)

Don’t use the LTS or stable version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Npm missing peer dependency - Stack Overflow
I have mis-understood the meaning of the ^ in version ^2.2.3 . After reading this link, ^2.2.3 means >=2.2.3 <3.X . That's why...
Read more >
validate-peer-dependencies - npm package - Snyk
Validate that the peerDependencies of a given package.json have been satisfied. For more information about how to use this package see README.
Read more >
npm-ci
An easy way to do this is to run, for example, npm config set legacy-peer-deps=true --location=project and commit the .npmrc file to your...
Read more >
npm-link
If set to true , and --legacy-peer-deps is not set, then any conflicting peerDependencies will be treated as an install failure, even if...
Read more >
npm-ls
The tree shown is the logical dependency tree, based on package dependencies, not the physical layout of your node_modules folder. When run as...
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