Just launched npm update
in my web application, and now Moment JS appears with an error with the following message:
Error: Cannot find module "./locale"
\node_modules\moment\src\lib\moment\prototype.js:1
> 1 | import { Moment } from './constructor';
I donβt know what version of Moment JS I had before my update, but my application has been working for several months.
I created another responsive application and ran npm install moment --save
and modified the source code to display the time, and ended up with the same error described above.
Not sure if there is a fault-tolerant way to integrate Moment JS using the Create-React-App, which is not currently used to manage webpack settings on its own, but I really don't want to. Does anyone else see these problems or have success? If so, a short entry will go the way to help.
source
share