moment-range dependency still not fixed - Error: Can't resolve 'moment-range'
hussaintamboli opened this issue · 6 comments
I followed the exact same installation and usage instructions from README.
# installation
npm install react-daterange-picker --save
# this installed "react-daterange-picker": "^2.0.1",
# usage
import DateRangePicker from 'react-daterange-picker';
import 'react-daterange-picker/dist/css/react-calendar.css';
...
But when I run my app, I get this dependency error -
ERROR in ./node_modules/react-daterange-picker/dist/moment-range.js
Module not found: Error: Can't resolve 'moment-range' in '/Users/hussain/react-frontend/node_modules/react-daterange-picker/dist'
@ ./node_modules/react-daterange-picker/dist/moment-range.js 11:19-42
@ ./node_modules/react-daterange-picker/dist/DateRangePicker.js
@ ./src/App.js
I found many similar issues in this project. But most of them are closed saying it's fixed in the latest version (probably in v2.0.0). But looks like it's not fixed because I am using v2.0.1.
Out of interest, what version of npm and node do currently have installed?
node v9.3.0
npm v6.0.1
@hussaintamboli If you install the moment-range
dependency directly, I assume this resolves the issue for you?
Yes. that fixes the issue.
Also, I just noticed npm gives warning for installing moment-range
when you install react-daterange-picker
$ npm install react-daterange-picker --save
npm WARN react-daterange-picker@2.0.1 requires a peer of moment-range@^3.0.3 but none is installed. You must install peer dependencies yourself.
If moment-range is a peer dep, it'll help if it was mentioned in the readme