Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install creates strange differences in package-lock.json between different machines

I've tried googling this but couldn't find anything so trying here - we've recently upgraded to node 16.13.0 and npm 8.1.0, and after doing npm install we get the following diffs in package-lock.json:

-      "devOptional": true
+      "dev": true

and

-      "integrity": "sha512-15Ft8p1vVEvBQDjZV6XSQULHIbRTetygyGyaF953pq/ukW0AnnHD3Kra7NasJxryWfbBrD18i11uors0CvnOwg==",
-      "requires": {}
+      "integrity": "sha512-15Ft8p1vVEvBQDjZV6XSQULHIbRTetygyGyaF953pq/ukW0AnnHD3Kra7NasJxryWfbBrD18i11uors0CvnOwg=="

This happens for a small percentage of packages, but that small percentage is 60ish packages and I don't understand why these differences happen (especially since we're using the same node/npm)

like image 286
Andrija Avatar asked Sep 10 '25 22:09

Andrija


1 Answers

For those who are having the same issue, check that npm config legacy-peer-deps is set to false

npm config ls -l | grep legacy-peer-deps to check its value

npm config set legacy-peer-deps false to set it to false

like image 53
David Ten Sing Avatar answered Sep 12 '25 14:09

David Ten Sing