Skip to content

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

Closed
@rsouthpaw

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions