npm install should warn about the presence of yarn.lock files

(Nick McCurdy) #1

Yarn gives a helpful warning message when a package-lock.json file is found:

yarn install v1.9.4
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.

npm should provide the opposite warning when yarn.lock files are found, suggesting to delete yarn.lock and continue using npm.

(Pirate Praveen Arimbrathodiyil) #2

I think it’d be great to support yarn.lock format and install versions specified there. yarn.lock and package-lock.json is trying to achieve the same thing anyway.

(Nick McCurdy) #3

Yarn lock files finally support integrity fields, so yarn.lock may have enough data to generate package-lock.json automatically now.