Why do I get significantly different `package-lock.json` files when I run` npm install` on different systems

In the same git repository, if I remove node_modules and package-lock.json , I expect that running npm install should generate the same package-lock.json every time (send or receive several modules that can get updated by the publisher in the interim period.

What I find is that I get significantly different files depending on whether I run this on an OSX machine compared to a Linux machine.

Can this be expected? If so, what is the value of package-lock.json , since it will be invalid on one of these systems. If not, what could happen here?

+5
source share
1 answer

Some dependencies are removed on some platforms. Perhaps some of them can be installed on the OSX machine, but not on Linux. So every time you run npm i , package-lock.json updated

For example, as some other users have pointed out, there is a fsevents package that has strict os requirements

You can find some open issues on github:

https://github.com/npm/npm/issues/17722

https://github.com/npm/npm/issues/18202

+2
source

Source: https://habr.com/ru/post/1270242/


All Articles