Posted on: Written by: K-Sato
⚠️ This article was posted over 2 years ago. The information might be outdated. ⚠️

Table of Contents

Introduction

npm uses the package.json file to specify the version of a package that your app depends on. npm uses the tilde (~) and caret (^) to designate which patch and minor versions to use respectively.

Versioning

npm packages follow Semantic Versioning.

major.minor.patch
1.0.2

Tilde

if you see ~1.0.2 it means to install version 1.0.2 or the latest patch version such as 1.0.4.

caret

If you see ^1.0.2 it means to install version 1.0.2 or the latest minor or patch version such as 1.1.0.

References

About the author

I am a web-developer based somewhere on earth. I primarily code in TypeScript, Go and Ruby at work. React, RoR and Gin are my go-to Frameworks.