Open sscaff1 opened 1 year ago
Good catch. You should also, ofc, not use legacy peer deps :-)
+1 @ljharb. --legacy-peer-deps
was meant as a stopgap solution for the ecosystem to catch up/fix issues. I think it's time to rip off the bandaid. I imagine the npm
CLI team should be queuing up deprecating the flag for v10 🙏🏻 I know that pnpm
will be installing peer deps by default in v8 (ref. https://twitter.com/ZoltanKochan/status/1630956825012064256) so I think it's time to drop any config that avoids/hides these conflicts.
If you are discussing deprecating the flag then we should definitely fix this to throw warnings so that people can use those warnings to help inform them on how to resolve the conflicts and be aware how many issues are potentially building up by using the legacy flag.
This just cost me hours of angry debugging because I didn't understand why my peer deps weren't installing and not even showing any warnings in the console. I eventually found that legacy-peer-deps has been silently enabled for months in the .npmrc of our project and everyone forgot about it because npm never tells you anywhere about it being enabled.
However, even with knowing that option was enabled I still didn't understand why npm install
and npm ci
wouldn't even show any warnings about missing peer deps. It just succeeded the install like everything was perfectly fine. But of course the code wouldn't run due to missing deps. So frustrating!
This just cost me hours of angry debugging because I didn't understand why my peer deps weren't installing and not even showing any warnings in the console. I eventually found that legacy-peer-deps has been silently enabled for months in the .npmrc of our project and everyone forgot about it because npm never tells you anywhere about it being enabled.
However, even with knowing that option was enabled I still didn't understand why
npm install
andnpm ci
wouldn't even show any warnings about missing peer deps. It just succeeded the install like everything was perfectly fine. But of course the code wouldn't run due to missing deps. So frustrating!
This. Same thing happened to us. One of our developers had silently enabled --legacy-peer-deps
without telling anyone, and because npm didn't throw any warnings or errors, nobody noticed the problem.
....Does anyone have any workaround, to get npm to display the peerDependencies that it's skipping?
Edit: As a workaround, I did:
node_modules
and package-lock.json
.npm install
. (It'll say in the output, but if you don't find it, it'll be located in someplace like: D:\Users\USERPROFILE\AppData\Local\npm-cache_logs\TIMESTAMP-debug-0.log) silly ADD
. It should be written several times, next to every package newly installed (which, because it was only installed the second time, was not installed during the npm install --legacy-peer-deps
). I hope that helps someone in the future.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When using legacy peer deps, npm no longer throws a warning for uninstalled peer dependencies.
Notice no warning for eslint-config-airbnb's peers.
Expected Behavior
You should see a warning. Notice that yarn throws a warning:
Steps To Reproduce
Environment