0

How to install latest stable version of a Javascript package via a package manager?

(no alphas, betas, etc.)

I tried NPM and did not find a solution. This question is similar.

I tried Bower and find nothing. Here is a question with no answer here.

Please help. Which package manager should I choose? Maybe there are another options around?

PS

For example: knockout.js, npm givers beta for latest. I don't want beta! I also would like to set the same limitation for dependencies - pull only stable versions.

Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191

1 Answers1

2

Installing a package without specifying a version will always install the latest version published to npm, including pre-releases (alpha, beta etc.):

npm install knockout

However, if you specify the version range, even only as a wildcard *, pre-release versions are explicitly excluded:

npm install knockout@*

See the npm docs for more info. Also, you can test this in npm's semver calculator.

TimoStaudinger
  • 41,396
  • 16
  • 88
  • 94