The problem of keeping plugins versioned consistently with the thing to which they plug in is still a big one for many projects. They are used for example if you want to include third party libraries that are not part of the npm registry, or distribute your project as a module. Specifically, they were introduced in a rudimentary form in npm 1. Details If you want to repeat this every time, clear out all the files from the project directory and leave just the package. If I comment it out, the install works. It is just intended to be a check, making sure that the parent project project that will depend on your project has a dependency on the project you hook into.
You can also find bundledDependencies and optionalDependencies, but I do not see them used that often. You will receive a warning that the peerDependency is not installed instead. All other modules depend on this core module with somewhat loose versioning, so that they get version updates whenever the core module decides to update things. You'll find an overview of all our open source projects. We have a few dependencies we want to use. It no longer actually installs the peerDependency packages. If it works for you too, awesome! The difference in this use case is; Instead of this problem silently existing.
This is an unfortunate and unavoidable situation where a human being has to figure out how to get out of dependency hell, because of the many many plugins and tools that require that they be the only version of themselves in the dependency tree think Flux, old versions of React, etc. Your platform info had everything I needed, including the version. It would be really annoying if one Chai plugin peer-depended on Chai 1. One piece of advice: peer dependency requirements, unlike those for regular dependencies, should be lenient. I thought maybe version numbers were wonky so i tried to strip them out running this next: npm install -S babel-polyfill core-js prop-types react react-dom.
This would install any missing peerDependencies at the top level. For all following versions of npm starting with , this will no longer be the case. This can be useful when developing modules. How to Fix It The error messages don't have to be related to the package you're trying to install. I personally think they shouldn't be both in dev dependencies and peer dependencies, but that could be a separate discussion.
If the transitive dependency was more specific than the peer dependency, that range would take precedence and all requirements would still be satisfied. We will also be changing the behavior of peerDependencies in npm 3. The offending step is this command: npm install -S babel-polyfill 6. To be clear, peerDependencies aren't going away. More information about the package. And then under npm-config 7 find dev: Default : false Type : Boolean Install dev - dependencies along with packages. Contributing Please see for details.
See npm-config 7 for more on the topic. Is there a way to install a declared packages in peerDependencies? I've read part of the discussion and was wondering, if it will be deprecated. The point is: I don't see how all this is relevant? Once you clone the project and run yarn - everything should be installed and you should be able to run tests, etc. However, this seems like it might be useful enough that if somebody wanted to put it together as a patch, we'd be happy to land it. In real-life, this sort of sucks. Now the question is, how can we get things so that all modules share the same instance of the core module within our app, in such a way that each module can also be used independently of the app? Semver ranges explained by npm: When in doubt always check: I think was talking about a scenario where you rely on a dependency of a dependency to pull in one of your peer dependencies.
This means that while in my project I downloaded version 1 of webpack, grunt-webpack depends on another set of versions to safely execute, so the package manager will intercede for us and warn us that this setup may break the program. Reply to this email directly, view it on GitHub , or mute the thread. If you depend on features introduced in 1. On the other hand yarn introduced an even more strict policy when it comes to this, it clears up the packages not otherwise defined as dependencies or devDependencies so you don't run into issues later on. Going with that, I think using devDependencies when asked to --save-dev is absolutely correct. Something that doesn't require a parent package, as do peerDependencies, but rather allows any number of modules to depend on one copy of a shared module, with warnings or errors in case there is a version conflict.