
Remove the ^ caret in front of the packages to lock. Using a caret () in an NPM package. I want to be able to lock the versions per release. The problem with this is let’s say I released two versions 6.21.0 and 6.22.0 (shown below), I was to use 6.21.0 I will get all the “latest” dependencies of packageA, packageB, and packageC because I have the ^ infront of all the packages. Out of the many things contained within the package.json file, dependency management is what we are going to talk about today. So as we can see in the above sample package.json file we have some dependencies & dev dependencies as well, now let's go close to dependencies. The package.json file is the heart of all npm packages and no matter what you might have in your project, one thing is for sure: there will always be a package.json file.
#PACKAGE JSON CARET UPDATE#
If you are earlier in dev, you probably want to update aggressively, so you have the most curent software when you decide to freeze updates. What is tilde () and a caret () in an npm package.json file If you are using npm to manage your app, then you know that we will use package.json for managing dependencies. If you are about to publish, maybe you want to freeze all updates, so no breaking change gets introduced accidentally. When doing a release now, all the packages currently have the ^ (caret) in front of them. On the other hand, A Caret () as a prefix to the version number in package. It depends on the package, and where you are at in your dev cycle.
