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.

Installed peer dependencies are marked as unused

See original GitHub issue

For example, babel-core is a peer dependency of babel-loader. It should not be marked as unused. The same goes for jasmine-core and karma-jasmine.

There are probably many more similar cases.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
robross0606commented, Apr 5, 2021

This still appears to be happening. My project has a peer dependency on prom-client:

npm WARN prometheus-gc-stats@0.5.1 requires a peer of prom-client@>= 10 < 12 but none is installed. You must install peer dependencies yourself.

However, depcheck lists it as unused after installation:

C:\Code\code>depcheck --version
1.4.0

C:\Code\code>depcheck
Unused dependencies
* prom-client
0reactions
remcohaszingcommented, Nov 29, 2016

It works! Thanks 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find unused npm packages in package.json - Stack Overflow
Install the module: npm install depcheck -g or yarn global add depcheck. Run it and find the unused dependencies: depcheck.
Read more >
How to fix npm dependency hell - Sylhare's blog
This will do a clean installation of the modules, removing the previous node modules and won't try to update the dependencies (which can...
Read more >
npm Peer Dependencies - Fathom
When you use peer dependencies, npm will not automatically install those dependencies (see comments above in respect to npm version 7). This can...
Read more >
eslint-plugin-unused-imports - npm
eslint-plugin-unused-imports. 2.0.0 • Public • Published a year ago. Readme · Code Beta · 1 Dependency · 339 Dependents · 17 Versions ...
Read more >
Error Codes | Yarn - Package Manager
The author of packageB can fix this problem by marking the packagePeer peer dependency as optional - but only if the peer dependency...
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