[Solved] Module not found: Error: Can’t resolve ‘date-fns/addDays’

While I am trying to use Date picker from MUI, then I am facing the flowing error Module not found: Error: Can’t resolve ‘date-fns/addDays’.

In this article, we will discuss about this Module not found: Error: Can’t resolve ‘date-fns/addDays’ error in ReactJs. And how to resolve the error all the possible solutions with examples.

How Module not found: Error: Can’t resolve ‘date-fns/addDays’ Error Occurs?

Most of the time you get this error while trying to use Date picker from MUI, looks like the below:

Module not found: Error: Can’t resolve ‘date-fns/addDays’
Module not found: Error: Can’t resolve ‘date-fns/addSeconds’
Module not found: Error: Can’t resolve ‘date-fns/addMinutes’
Module not found: Error: Can’t resolve ‘date-fns/addHours’
Module not found: Error: Can’t resolve ‘date-fns/addWeeks’
Module not found: Error: Can’t resolve ‘date-fns/addMonths’
Module not found: Error: Can’t resolve ‘date-fns/addYears’

How To Fix Module not found: Error: Can’t resolve ‘date-fns/addDays’ Error?

There are differents way to fix Module not found: Error: Can’t resolve ‘date-fns/addDays’ this error. Let us take a look at every solution.

  • How To Fix Module not found: Error: Can’t resolve ‘date-fns/addDays’ Error?

To Solve Module not found: Error: Can’t resolve ‘date-fns/addDays’ Error You don’t have the date-fns package installed, then you have to install the date-fns package from NPM with this following command: npm install –save date-fns. Now, your error will be solved.

  • Module not found: Error: Can’t resolve ‘date-fns/addDays’

To Solve Module not found: Error: Can’t resolve ‘date-fns/addDays’ Error Maybe you don’t have the date-fns package installed All You need to do is just install the date-fns package from NPM using the following command: npm install –save date-fns Now, Your error will be gone.

Solution 1: Install date-fns

You have to install the date-fns package from NPM using the following command.

npm install --save date-fns

Now, Your error must be solved.

Conclusion

In this article, we have discussed what causes the error and we have discussed ways to fix the error.

we hope this article has been informative. Thank you for reading. Kindly comment and let us know if you found it helpful.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Categories