Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When installing via npm install our-library@">4.2.0-beta", npm does not find any version to install. It ignores any pre-release version unless you specify the exact pre-release version. Same with npm outdated, it does show that there is a new pre-release version available in the Latest column, but Wanted column is always current installed pre-release version. I have tried using >4.2.0-beta, ^4.2.0-beta, and ~4.2.0-beta. None will cause the outdated to show the new pre-release as wanted.
Expected Behavior
With the use of >4.2.0-beta, outdated and install should consider pre-release versions. Or add a command line switch to enable looking for pre-release versions.
Steps To Reproduce
Installing
- Build library that has pre-release version
1.0.1-beta-123 and publish it to npm repo.
- Try to install using
>1.0.0-beta
Updating
- Build library that has pre-release version
1.0.1-beta-123 and publish it to npm repo.
- Install using
@^1.0.1-beta-123
- Build new pre-release version
1.0.2-beta-456 and publish it to npm repo.
- Run
npm outdated. Wanted shows 1.0.1-beta-123, Latest shows 1.0.2-beta-456
Environment
- npm: 10.9.0
- Node.js: v21.7.3
- OS Name: Windows 11
- npm config:
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When installing via
npm install our-library@">4.2.0-beta", npm does not find any version to install. It ignores any pre-release version unless you specify the exact pre-release version. Same withnpm outdated, it does show that there is a new pre-release version available in the Latest column, but Wanted column is always current installed pre-release version. I have tried using>4.2.0-beta,^4.2.0-beta, and~4.2.0-beta. None will cause the outdated to show the new pre-release as wanted.Expected Behavior
With the use of
>4.2.0-beta, outdated and install should consider pre-release versions. Or add a command line switch to enable looking for pre-release versions.Steps To Reproduce
Installing
1.0.1-beta-123and publish it to npm repo.>1.0.0-betaUpdating
1.0.1-beta-123and publish it to npm repo.@^1.0.1-beta-1231.0.2-beta-456and publish it to npm repo.npm outdated. Wanted shows1.0.1-beta-123, Latest shows1.0.2-beta-456Environment