hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.59k stars 672 forks source link

Can't resolve 'date-fns' #386

Closed rusakovic closed 4 years ago

rusakovic commented 4 years ago

Subject of the issue

./node_modules/react-date-range/dist/defaultRanges.js Module not found: Can't resolve 'date-fns' in 'C:\project\node_modules\react-date-range\dist'

Environment

Package Version: 1.0.3 React version: 16.12 Node version: 12.16 Browser: Chrome 83

How to fix it? Thank you

Solution: npm install date-fns

Should be added to docs.

gsouf commented 4 years ago

That's a peer deps, that's expected

keremciu commented 4 years ago

@rusakovic yep as @gsouf wrote, it's written on readme This plugin expects react and date-fns as peerDependencies, It means that you need to install them in your project folder.

hope you didn't spend much time on it :/