date-fns: Module not found: Can't resolve 'date-fns/_lib/format/longFormatters'

Hi, I’m using date-fns with material-ui like that : https://material-ui.com/components/pickers/

But this appears : ./node_modules/@date-io/date-fns/build/index.esm.js Module not found: Can't resolve 'date-fns/_lib/format/longFormatters' in '....node_modules\@date-io\date-fns\build'

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

Take note that two packages need to be installed to make it work:

Run npm i @date-io/date-fns@1.x date-fns --save

You probably have to install date-fns, if it doesn’t help please direct the question to https://github.com/dmtrKovalenko/date-io.

Why in the name of all that is good, is there a package for @date-io/date-fns and date-fns?? and why in the world does one depend on the other??

Yes, I’m installing it right now I didn’t pay attention. I didn’t close the issue in case the problem persists. Thanks for help 👍 !

Take note that two packages need to be installed to make it work:

Run npm i @date-io/date-fns@1.x date-fns

Thanks. This worked.

I’m getting the same issue, and I tried the answers mentioned above i.e.,

npm i @date-io/date-fns@1.x date-fns --save

still my issue is not resolved, can someone please suggest any other alternatives so I will try out.