Reputation: 20361
I am using NPM version 6.12.1. When I enter the following command into a Windows console in my project folder:
npm install
I get this output:
npm WARN [email protected] requires a peer of typedoc@^0.4.1 but none is installed. You must install peer dependencies yourself.
But this command:
npx typedoc -v
Outputs this:
TypeDoc 0.15.3
So it seems to me that the dependency is met. The message should not be there.
I've already googled this and found a few threads where people report a similar problem and it was caused by a bug in NPM. The threads however are several years old. Am I missing something or could this still be a bug?
Upvotes: 0
Views: 192
Reputation: 538
Peer dependency is some library, without which part of functionality will not work. You only interested in that, if you really need to use that very funcitonality, in most of cases it is completely optional and you no need to bother with it.
And even though you have needed package its version is different, so it does not recognized as package which satisfy that peer dependency. Semver is used here and leftmost non zero version considered to be major, major versions considered to have breaking changes, thus they do not compares in the same range.
Example: 0.0.1 and 0.0.2 would be considered as different major versions, as only significatnt non zero version is on the right. 0.2.1 and 0.2.2 will be in the same range 0.2.4 and 0.3.1 will be again different major
Upvotes: 1