Skip to content

support inherited dependencies ("peerDependencies") #5

Closed

Description

@jkroso

packages like pg-then will require('pg') even though they don't declare it as a dependency. This works with npm since pg-then ends up being installed in the same node_modules folder as pg but when they are symlinked from a global store this doesn't work. And babel-runtime does require('babel-runtime'). haha

These packages should declare these dependencies in "peerDependencies" but they don't because with npm they can get away without it.

And BTW the hackery I mentioned in #1 won't be necessary if pnpm support "peerDependencies" and if packages use it correctly

Activity

  1. rstacruz commented on Jan 29, 2016

    @rstacruz
    Member

    And babel-runtime does require('babel-runtime'). haha

    This is accounted for, actually. [email protected]/node_modules/babel-runtime is a symlink to [email protected]. I don't know why they'd bother doing that though, it seems only babel-runtime@^5 has this issue... but yeah, I'm able to get babel to work with pnpm through this. ied does the same.

    These packages should declare these dependencies in "peerDependencies" but they don't because with npm they can get away without it.

    peerDependencies isn't "supported" by npm, btw. Modern npm2 and npm3 versions won't install any peerDependencies for you. With pg-then + pg, you're expected to add both to your project. This is the same with other similar setups (some of these examples declare others as peerDependencies, some don't):

    • eslint + eslint-config-standard
    • jsdom + jsdom-global
    • pg + knex
    • babel-preset-es2015 + babel-runtime (or babel-register, babelify, babel-core)
    • browserify + babelify
    • etc...

    pnpm more or less mirrors npm@2's behavior.

  2. modified the milestone: v1.0.0 on Aug 18, 2016
  3. added 2 commits that reference this issue on Aug 17, 2018
    69315d0
    1bc420f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions