1

After deleting my package-lock.json, and the node modules folder, and running an npm install on my project, I noticed that it is installing a lower version of @babel/core than what is specified in my package.json. It seems to be installing 7.17.12 when it should be installing 7.17.5 (you can see the difference between the previous package-lock.json):

enter image description here

My package.json specifies @babel/core should be at least 7.17.5:

enter image description here

The weird part is, when I go into my node modules folder after this has happened, and check on @babel/core's package.json I can see that it has in fact installed the 7.17.12 version. However, it has a _from field that states 7.17.5: enter image description here

connected_user
  • 814
  • 1
  • 9
  • 25
  • This only happens, when deleting my package-lock.json and then doing an npm install. If I keep my package-lock and run npm install, this doesn't happen. – connected_user Aug 25 '22 at 20:12
  • 1
    I cannot see what the issue is here because what’s happening seems to be as expected. If I use the [semver calculator](https://semver.npmjs.com/) and enter `@babel/core` in the _"pick a package"_ field, then enter `~7.17.5` (as per your _package.json_) in the _"enter a range"_ field it shows that it resolves to version `7.17.12`. – RobC Aug 26 '22 at 12:47
  • Okay, so I suppose its acting as expected then. I assumed it would've atleast gotten version 7.17.5 – connected_user Aug 26 '22 at 13:13

0 Answers0