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

Hello readers, Today In this article I am going to show you how to Solve – Module not found: Error: Can’t resolve ‘date-fns/addDays’ error in ReactJs. So here I will explain all the possible solutions.

Without wasting your time, Let’s start This Article to Solve This Error.

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

This is a common error in Nodejs. When I am trying to use Datepicker from MUI, but I got the following error. It looks as like 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’

So here are all the possible solutions that I tried to fix this error.

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

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

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.

  • 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