NPM install behaves differently in different situation, unable to understand if it's correct or not?
npm initto initialize the project- I am using
axios: "~1.2.4"in the package.json file- when I run
npm installpackage1.2.6will be installed which is correct as the latest patch will be installed - now if I use
^1.2.4in package.json and runnpm installthenode modulesorpackage-lock.jsonwon’t get updated to1.3.6which is the intended behaviour based on the usage of^(why is this happening here?) - now if I use
^1.3.4in package.json and runnpm installthenode modulesandpackage-lock.jsonboth will get updated to use1.3.6which is the intended behaviour (and I suppose this is correct) - now if I use
1.2.4or1.3.4the packages with the version will be installed
- when I run
Also, what is the actual use of the .package-lock.json file?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/nfDTGYI
Comments
Post a Comment