question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:

  1. check npm 7 is installed
  2. 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:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
eps1loncommented, Nov 19, 2020

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.

2reactions
oliviertassinaricommented, Nov 19, 2020

Does npm 7 installs optional peer dependencies automatically?

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found