How to fix npm WARN peer dep missing: react@^17.0.0, required by package-name in npm
npmBEGINNERLOWUpdated Dec 2, 2025ยท 101 views
A package expects a peer you have not installed. Add the required peer in a compatible version or remove the package that needs it.
Quick fix
Fixes npm WARN peer dep missing: react@^17.0.0, required by package-name
npm install react@17 # example from the warning- Install the required peer
- Match the requested range
- Remove unused plugins
npm โ error
npm install react@17 # example from the warningnpm WARN peer dep missing: react@^17.0.0, required by package-name
shell
npm install react@17 # example from the warningWhat this error means
Peer dependencies must be provided by the consuming project. When a peer is absent, npm warns that the package may not work correctly.
Typical symptoms
- npm WARN peer dep missing: <pkg>@<range>
- Runtime errors for missing framework/library peer
- Warnings during install or build
Common causes
- Required peer package not installed in the project
- Installing a plugin without its host framework/library
How to fix "npm WARN peer dep missing: react@^17.0.0, required by package-name"
1Install the required peer
Add the missing dependency at a compatible version:
bash
npm install react@17 # example from the warning2Match the requested range
Use a version within the warned range to avoid conflicts. If you must differ, ensure the plugin supports it.
3Remove unused plugins
If you do not need the package requiring the peer, uninstall it to silence the warning:
bash
npm uninstall package-nameAdvanced notes
For libraries, declare peers in package.json and keep them minimal. For apps, installing the peer in dependencies (not dev only) ensures it is present at runtime.
Frequently asked questions
- What does "npm WARN peer dep missing: react@^17.0.0, required by package-name" mean?
- Peer dependencies must be provided by the consuming project. When a peer is absent, npm warns that the package may not work correctly.
- How do I fix "npm WARN peer dep missing: react@^17.0.0, required by package-name"?
- A package expects a peer you have not installed. Add the required peer in a compatible version or remove the package that needs it.
- What causes "npm WARN peer dep missing: react@^17.0.0, required by package-name"?
- Required peer package not installed in the project Installing a plugin without its host framework/library
- Is the "npm WARN peer dep missing: react@^17.0.0, required by package-name" error serious?
- It is a low-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐npm Official Documentation
- ๐npm Docs: peerDependencies(Official Docs)
- ๐ฌStack Overflow: meaning of peer dependencies(Stack Overflow)
- ๐