NPM install behaves differently in different situation, unable to understand if it's correct or not?
npm init
to initialize the project- I am using
axios: "~1.2.4"
in the package.json file- when I run
npm install
package1.2.6
will be installed which is correct as the latest patch will be installed - now if I use
^1.2.4
in package.json and runnpm install
thenode modules
orpackage-lock.json
won’t get updated to1.3.6
which is the intended behaviour based on the usage of^
(why is this happening here?) - now if I use
^1.3.4
in package.json and runnpm install
thenode modules
andpackage-lock.json
both will get updated to use1.3.6
which is the intended behaviour (and I suppose this is correct) - now if I use
1.2.4
or1.3.4
the 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