Michael Michael - 3 months ago 15
Node.js Question

npm install using pre-release versions

i want to use pre-release versions in my package.json to get some dependencies in the latest version (containing als pre-releases) but for some reasons it doesn't work in my case. The pre-releases are fully ignored. As an example lets use angular. If I ask

"angular": ">=1.4.0-rc.0 <1.4.1"
as an dependency, i would expect that i would get the version
1.4.0-rc.2
installed, but i get just the version
1.4.0
.

The
npm info angular
shows, that there are some rc versions available like


...

'1.4.0-beta.4',

'1.4.0-beta.5',

'1.4.0-beta.6',

'1.4.0-rc.0',

'1.4.0-rc.1',

'1.4.0-rc.2',



My package.json looks as follows right now

"dependencies": {
"angular": ">=1.4.0-rc.0 <1.4.1"
}


Any ideas why i dont get any rc versions? What do i have to do to get it working?

Answer

This seems logical, the order of versions is normally the following (for angular releases 1.4.x):

  1. 1.4.0-beta.0
  2. 1.4.0-beta.2
  3. 1.4.0-beta.3
  4. 1.4.0-beta.4
  5. 1.4.0-beta.5
  6. 1.4.0-beta.6
  7. 1.4.0-rc.0
  8. 1.4.0-rc.1
  9. 1.4.0-rc.2
  10. 1.4.0
  11. 1.4.1

If you request "angular": ">=1.4.0-rc.0 <1.4.1", The latest version that is less strictly 1.4.1 is 1.4.0

Anyway, if you demand "angular": ">=1.4.0-rc.0 <1.4.0", the lastest version will be 1.4.0-rc.2

Comments