close

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

I am using Datepicker in my react project but I am facing the following error Module not found: Error: Can’t resolve ‘date-fns/addDays’ in ReactJS. We are going to Learn about All Possible Solutions So Lets Get Start with This Article.

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

I am using Datepicker in my react project but I am facing the following error:

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 I am writing all the possible solutions that I have tried to resolve this error.

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

  1. 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 must be solved.

  2. 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 must be solved.

Solution 1: Install date-fns

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 must be solved.

Summary

It’s all About this error. Hope We solved Your error. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment