Thursday 30 May 2019

[Discussion] How do you maintain the exact version of packages to be installed across OSes?

ScenarioAt my company, developers use MacOS and we use yarn to manage dependency. Production runs on Ubuntu 14.04.I understand that once you run yarn install, yarn.lock file is generated, which specifies the exact version of each package in your project (this is different from package.json which may not specify an exact version but a range).I had thought that the packages in yarn.lock file only depends on two things: * nodejs version at the time the yarn.install was run * package.json fileHowever I was wrong. Apparently, the packages in yarn.lock are also OS dependent. I knew this when I accidentally did the following: 1. On Ubuntu 14.04, nodejs 6.10.0, runs yarn install -> a yarn.lock file is generated. 1. Copy that yarn.lock file onto MacOS which also runs nodejs 6.10.0. Runs yarn install --frozen-lockfile.The result was that the installation worked on Ubuntu (where the yarn.lock file was generated) but failed on MacOS even though I use the same node version on both OS.Question How do you make sure the exact versions of the packages work across OSes, especially native ones (like node-rdkafka I think)?

Submitted May 31, 2019 at 03:39AM by devops_wannabe

No comments:

Post a Comment