Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bower dependency tilde in Node

In bower (a node dependency package manager), on some dependencies the version is preceded by a tilde. What does this mean?

{     "name": "mean",     "version": "1.0.0",     "dependencies": {         "bootstrap": "3.0.0",         "angular": "~1.0.6"     } { 
like image 482
andygoestohollywood Avatar asked Oct 23 '13 12:10

andygoestohollywood


People also ask

What is tilde in package Json?

Tilde (~) notation: It is used to match the most recent patch version. Tilde ~ notation freezes the major version and minor version. As we know patch updates are bug fixes that's why we can say ~ notation allows us to automatically accept bug fixes. Example: The ~1.2. 0 will update all the future patch updates.

What is Bower vs NPM?

Bower is a package manager, like npm, which manages frameworks, libraries, assets, and utilities, installs them, and makes sure they are up to date. Traditionally, many web development projects combined npm and Bower. npm was used to manage back-end dependencies, while Bower was used for front-end dependencies.

How do I install Bower components?

You can also create a bower. json file and define multiple packages name with or without version. Navigate to your project folder directory and run the command “bower install”. It will download and install all the packages in your bower_components folder.

How do I know my Bower version?

Bower lets you query the bower registry via the command line to find a package by a given name and then list its versions. e.g.


1 Answers

~1.2.3 := >=1.2.3-0 <1.3.0-0 "Reasonably close to 1.2.3". When using tilde operators, prerelease versions are supported as well, but a prerelease of the next significant digit will NOT be satisfactory, so 1.3.0-beta will not satisfy ~1.2.3.

From the documentation of the underlying semver

like image 52
Maxim Krizhanovsky Avatar answered Oct 17 '22 00:10

Maxim Krizhanovsky