Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install the latest minor version of a package on npm?

For example:

  • I have version 2.0.0 of package-name installed.
  • The latest minor version that has the same major version is 2.1.2
  • The latest major version (which would be installed if I ran npm install package-name@latest is 4.3.0

How can I install the most recent package that does not have breaking changes?

like image 745
mikemaccana Avatar asked Sep 16 '16 13:09

mikemaccana


People also ask

How do I update npm packages to certain versions?

To update a specific package, we need to run the npm update command followed by the package name. Sometimes, you want to update a package to the specific version in such cases you need to use npm install command by specifying a version number after the package name.

What is minor version in npm?

The Semantic Versioning concept is simple: all versions have 3 digits: x.y.z . the first digit is the major version. the second digit is the minor version.

How install npm 6.14 15?

The command is npm install npm@latest -g to install it globally. This will install the latest version that will run with the node. js you have installed. Additionally you can install a specific version of npm to your package.

Does npm install update package versions?

The npm install installs all modules that are listed on package. json file and their dependencies. npm update updates all packages in the node_modules directory and their dependencies.


1 Answers

Use npm install package-name@"<next-major.0.0"

For example:

npm install package-name@"<3.0.0" would install the latest right before 3.0.0 (e.g. 2.11.1)

like image 195
Kevin Danikowski Avatar answered Sep 25 '22 00:09

Kevin Danikowski