Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Can't resolve 'moment' in '/Users/xxx/react/project_name/node_modules/react-datepicker/es' #1457

Closed
rsouthpaw opened this issue Aug 20, 2018 · 3 comments

Comments

@rsouthpaw
Copy link

rsouthpaw commented Aug 20, 2018

I installed the momentjs using "npm i react-moment --save"
My moments js is installed in node_modules/react-moment
Should I import
import moment from 'react-moment';
or
import moment from 'moment'; (this is given in example)
Although both are not working, I get the same error!

Expected behavior

Should be able to import react correctly

Actual behavior

Gives module not found error

Steps to reproduce

Installed datepicker using npm
installed momentjs using npm
Still getting this error

@a-x-
Copy link
Contributor

a-x- commented Aug 20, 2018

Did you restarted your builder watch mode?

@Kuubs
Copy link

Kuubs commented Aug 30, 2018

I had the same issue with the following dependencies:

"dependencies": { "firebase": "^5.4.1", "moment": "^2.22.2", "react": "^16.4.2", "react-datepicker": "^1.6.0", "react-dom": "^16.4.2", "react-loadable": "^5.5.0", "react-moment": "^0.7.9", "react-router": "^4.3.1", "react-router-dom": "^4.3.1", "react-scripts": "1.1.5" },

After deleting the node_modules and a fresh npm install it seems to work

@martijnrusschen
Copy link
Member

Moment.js was removed in #1527, starting v2.0.0, this package doesn't use Moment anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants