Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Just ran an npm update on my web application and now Moment JS appears to be failing with the following message:

Error: Cannot find module "./locale"

ode_modulesmomentsrclibmomentprototype.js:1
> 1 | import { Moment } from './constructor';

Not sure what version of Moment JS I had prior to my update, but my application has been working for months.

I created another react app and ran an npm install moment --save and modified the source to display the time and ended up with the same error described above.

Not sure if there is a fail-proof way to integrate Moment JS using Create-React-App currently short of ejecting to manage the webpack settings myself, but I really don't want to do this. Anyone else seeing these issues or having success? If so, a short write up would go along way to helping out.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
353 views
Welcome To Ask or Share your Answers For Others

1 Answer

Appears this has already been identified as an issue for Moment JS version 2.19. If you have upgraded to 2.19 run npm install moment@2.18.1 to revert back to previous version until it is fixed!

See thread: https://github.com/moment/moment/issues/4216


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...