MohGovIL / hamagen-react-native

Israel's Ministry of Health's COVID-19 Exposure Prevention App
https://health.gov.il/
MIT License
508 stars 153 forks source link

Both package-lock.json & yarn.lock in repo that declare different versions (not synced) #265

Closed emanuelb closed 4 years ago

emanuelb commented 4 years ago

yarn.lock at: https://github.com/MohGovIL/hamagen-react-native/blob/7d517d5e115a993aa2146d8cbae148992478f181/yarn.lock package-lock.json at: https://github.com/MohGovIL/hamagen-react-native/blob/df4594faeaab24fd22787888101a5201a830689f/package-lock.json

yarn.lock is used by yarn tool. package-lock.json is used by npm tool.

When running yarn install:

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

Above files are not synced, running yarn import after rm yarn.lock; npm install; will generate yarn.lock file that show differences.

also possible to convert them by using synp tool npm install -g synp to convert between the yarn.lock & package-lock.json files:

from

rm -rf ./node_modules/
rm package-lock.json;
yarn install;
synp --source-file yarn.lock
rm -rf ./node_modules/
rm yarn.lock
npm install
synp --source-file package-lock.json

example of differences:

in package.json declared: https://github.com/MohGovIL/hamagen-react-native/blob/40d0de490d47d53d2a005a57270b98a4176745f5/package.json#L81

while in yarn.lock used version 8.0.2 https://github.com/MohGovIL/hamagen-react-native/blob/7d517d5e115a993aa2146d8cbae148992478f181/yarn.lock#L1390-L1393

but in package-lock.json used version 8.0.3: https://github.com/MohGovIL/hamagen-react-native/blob/df4594faeaab24fd22787888101a5201a830689f/package-lock.json#L3091-L3096

There more differences like this (that affect non devDependencies).

fix: Use only 1 file as lock-file, or ensure they are synced (so rebuild that use either of those files will have the same versions installed)