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 ( node@12.6.1 and presumably the npm version it bundles by default - I'm seeing the behaviour in https://repl.it/repls/HastyGregariousServerapplication)
I have 3 questions
- Is this behaviour correct - should '*' really exclude prereleases? In other words, is this a bug in npm's treatment of peerDependencies
- 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'
- 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?
What / Why
In my package fetch-mock I declare a peerDependency of
node-fetch: '*'According to the documentation this should allow any version:
The behaviour I'm seeing is that it will only ever install non-prereleases of node-fetch ( node@12.6.1 and presumably the npm version it bundles by default - I'm seeing the behaviour in https://repl.it/repls/HastyGregariousServerapplication)
I have 3 questions
*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'