19 ms·
A package depending on itself is just an accident (and probably something npm ought to detect on publish and reject, but alas...) However, I believe a 1-packag
by julianlam 6y ago
A package depending on itself is just an accident (and probably something npm ought to detect on publish and reject, but alas...)
However, I believe a 1-package circular dependency is often the result of a developer mistakenly adding a package as a dependency when they mean to add it to `peerDepedencies`:
e.g. in TFA: "babel-core depends on babel-register, which depends on babel-core... yeoman-generator depends on yeoman-environment which depends on yeoman-generator."
Peer dependencies, of course, no longer exist because it got deprecated because raisins.
Which leaves us with zero options to define sideways dependencies.
- diiq 6y agoWhere did you read peerDependencies was deprecated? It's still valid and recommended, AFAIK: https://docs.npmjs.com/files/package.json#peerdependencies https://docs.npmjs.com/files/package.json#peerdependencies
- wldcordeiro 6y agoI think they meant the behavior of not installing peerDependencies was "deprecated".
- julianlam 6y agoRight, I misspoke. However what's the point of calling it a "dependency" when you don't install it alongside?