Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
Module not found: Can't resolve '@date-io/date-fns'

I'm using React Material UI and I get this error : Module not found: Can't resolve '@date-io/date-fns'.

Here are the dependencies that I have in my package.json file :

"dependencies": {
    "@date-io/date-fns": "^2.0.0",
    "@material-ui/core": "^4.9.5",
    "@material-ui/pickers": "^3.2.10",
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event": "^7.2.1",
    "axios": "^0.19.2",
    "date-fns": "^2.0.0",
    "react": "^16.13.0",
    "react-dom": "^16.13.0",
    "react-facebook-login": "^4.1.1",
    "react-google-login": "^5.1.14",
    "react-google-maps": "^9.4.5",
    "react-hook-form": "^5.2.0",
    "react-router": "^5.1.2",
    "react-router-dom": "^5.1.2",
    "react-scripts": "3.4.0"
  },

I tried installing the last version of date-io/date-fns, then tried the version 2.0.0 and version 1.0.0 and I still get the same error.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

$ npm i --save date-fns@next @date-io/date-fns@1.x
reference:
https://github.com/mui-org/material-ui-pickers/issues/240
https://github.com/dmtrKovalenko/date-io/issues/33

Reference: https://material-ui-pickers.dev/getting-started/installation#peer-library

Important: For material-ui-pickers v3 use v1.x version of @date-io adapters.

npm i @date-io/date-fns@1.x date-fns
// or
npm i @date-io/moment@1.x moment
// or
npm i -s @date-io/luxon@1.x luxon
// or
npm i -s @date-io/dayjs@1.x dayjs
over 4 years ago · Santiago Trujillo Report

0

You can check this Commands...

yarn add date-fns

or

npm i date-fns
over 4 years ago · Santiago Trujillo Report

0

In my code, I have used "import DateFnsUtils from "@date-io/date-fns/build/date-fns-utils", which caused "Module not found: Error: Can't resolve '@date-io/date-fns/build/date-fns-utils' ..." exception.

I have fixed this by importing from @date-io/date-fns'.

import DateFnsUtils from '@date-io/date-fns';
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!