[DatePicker] Installing @material-ui/lab with npm 7 installs moment, date-fns, luxon, dayjs
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
All the date engines are installed and in the package-lock.json
Expected Behavior 🤔
Only the date engine I need is installed and in the package-lock.json
Steps to Reproduce 🕹
Steps:
- check npm 7 is installed
npm install @material-ui/lab@5.0.0-alpha16
Context 🔦
In https://github.com/dmtrKovalenko/date-io/issues/500, I was reporting a similar issue with yarn v1, the following warnings are raised
warning "@material-ui/lab > @date-io/dayjs@2.10.6" has unmet peer dependency "dayjs@^1.8.17".
warning "@material-ui/lab > @date-io/luxon@2.10.6" has unmet peer dependency "luxon@^1.21.3".
warning "@material-ui/lab > @date-io/moment@2.10.6" has unmet peer dependency "moment@^2.24.0".
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v5.0.0-alpha.16 |
npm | 7.0.11 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
[DatePicker] Installing @material-ui/lab with npm 7 ... - GitHub
[DatePicker] Installing @material-ui/lab with npm 7 installs moment, date-fns, luxon, dayjs #23597 ; Current Behavior ; Expected Behavior.
Read more >Installation - Material-UI Pickers
Step-by-step guide how to install @material-ui/pickers. ... We are providing interfaces for moment, date-fns 2, luxon and dayjs.
Read more >material ui lab date picker, Can't resolve ... - Stack Overflow
This works for me very well npm install @mui/lab. In Material UI v5 you need to install @mui/lab.My dependencies are here :
Read more >@date-io/moment - npm
Start using @date-io/moment in your project by running `npm i @date-io/moment`. There are 606 other projects in the npm registry using ...
Read more >You might not need date-fns - DEV Community
Date-fns is not lightweight library for date/time management. There are underrated alternatives – e.g. Dayjs is much smaller when using around ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you don’t want to listen then I don’t have anything to say. Npm installs peer dependencies automatically now. If you want to solve this on your own without involving package manager folks then good luck.
Note that your analysis is wrong. You wanted to integrate pickers so you can’t declare their peers as “unrelated” all of the sudden. Either include pickers or not. Good luck.
I went on testing it, it looks like npm 7 doesn’t install optional peer dependencies. So as far as I understand, each of the four options presented are possible. I don’t think that Material-UI will have a weight in influencing the outcome of npm 7 installing or not peer dependencies. I also think that the warnings in yarn v1 need to be solved. I don’t know what the story looks like with yarn v2, I have never used it.