
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
peer-version-check
Advanced tools
Check whether every peerDependency is defined as a devDependency
As we all know, npm 3 changed to not install peerDependencies automatically. peerDependencies are still be useful and used by many package authors these days.
As a package author it's quite anoying during development that peerDependencies are not installed automacily anymore. There is an open feature request in the yarn repostiroy to allow install peerDependencies during development.
Recently one of my colleague suggested me to add them as devDependencies. Obviously duplicating is not the best solution, but it works. However there is a risk that they can get out of sync easily. To solve this issue, I wrote this CLI which checks if every peerDependency is defined as a devDependency with the same semver range.
$ npm install peer-version-check
before_script:
npx peer-version-check
$ peer-version-check <path-to-package.json> (optional)
$ peer-version-check ./package.json
Expected devDependency 'lodash' to be:
^4.0.0
Found:
^3.0.0
Exits with code 0 if every peerDependency is defined as a devDependency with the same semver range. If not exits with code 1 and an error message.
Common npm mistakes - Excellent article to read
MIT © Stefan Buck
FAQs
Check whether every peerDependency is defined as a devDependency
The npm package peer-version-check receives a total of 4 weekly downloads. As such, peer-version-check popularity was classified as not popular.
We found that peer-version-check demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.