Skip to content

[QUESTION] Should '*' include prereleases #329

@wheresrhys

Description

@wheresrhys

What / Why

In my package fetch-mock I declare a peerDependency of node-fetch: '*'

According to the documentation this should allow any version:

  • := >=0.0.0 (Any version satisfies)

The behaviour I'm seeing is that it will only ever install non-prereleases of node-fetch ( [email protected] and presumably the npm version it bundles by default - I'm seeing the behaviour in https://repl.it/repls/HastyGregariousServerapplication)

I have 3 questions

  1. Is this behaviour correct - should '*' really exclude prereleases? In other words, is this a bug in npm's treatment of peerDependencies
  2. Assuming the behaviour is correct, I guess the docs above mean * is an alias for >=0.0.0, and it's misleading to describe this as 'Any version satisfies' - it would be more correct to change the documentation to read 'Any non-prerelease version satisfies'
  3. Also assuming the behaviour is correct, is there any way I can genuinely express a dependency on a package that will allow any version, including prereleases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions