--force, or --legacy-peer-deps what is the differences between these two commonds.
Asked
Active
Viewed 304 times
-2
-
Welcome to Stack Overflow! To learn more about this community and how we can help you, please start with the [tour](https://stackoverflow.com/tour) and read [How to Ask](https://stackoverflow.com/help/how-to-ask) and its linked resources. – sohaieb azaiez Mar 12 '22 at 10:39
1 Answers
1
Since NPM v7 now installs peerDependencies by default. The --legacy-peer-deps flag was introduced with v7 as a way to bypass peerDependency auto-installation; it tells NPM to ignore peer deps and proceed with the installation anyway. This is how things used to be with NPM v4 thru v6.
You can read well written answer about above here: What does npm install --legacy-peer-deps do exactly? When is it recommended / What's a potential use case?
on the other hand, --force will simply force npm to redownload all dependencies.

programcoder19
- 111
- 7