dedupe: respect dependency versions

When a package depends on other packages that have a common dependency, `npm dedupe` always updates the dependency to the latest published version.

This PR makes `npm dedupe` check if the version satisfies the dependency requirements before updating it. 

---

More info on #4675