If I am installing a package using the @latest
option the semantic versioning found for this package in the package.json is removed.
I have removed the package-lock.json
file and the node_modules
folder before doing the installation and this is still happening.
package.json
before:
"dependencies": {
"@awesomeproject/my_dep": "^1.0.4”,
}
Running:
npm install @awesomeproject/my_dep@latest
package.json
after
"dependencies": {
"@awesomeproject/my_dep": "1.0.5",
}
expected:
"dependencies": {
"@awesomeproject/my_dep": "^1.0.5",
}
This is affecting only one specific package consistently. Other packages in the project are not affected, leading me to believe that this is something from that package and not from the project that is trying to update it. It should not be a problem changing anything in this package since I am the owner.
This is not the same problem as this question: Why does `npm install` add / remove caret (^) to / from version numbers? Since this is affecting all the packages.
EDIT:
I want to save the newest version of the package to the package.json
.