Perhaps "moment" shall be specified as peerDependency for npm package?
Hey @timrwood. Any comment on this? We're having issues with localization in our setup where we're using browserify to be able to use npm packages in the browser. The problem is that moment-timezone uses it's own instance of moment, so when we go ahead and set the locale of our instance of moment, then the instance managed by moment-timezone is (of course) not updated accordingly.
This leads third party dependencies that rely on moment to adhere to a different locale than the third party dependencies relying on moment-timezone. Not to mention that it is suboptimal to ave two instances of moment running right?
Thanks for maintaining this repo by the way :)
No thoughts on this? It's really weird to have 2 moment installed on my node_modules.
I have the direct dependency for moment and moment-timezone. But the last also has a dependency for moment, so what I have is this:
โโโ [email protected]
โโโฌ [email protected]
โโโ [email protected]
Even with the same version, npm install the second dependency. Probably with PeerDependency would solve this problem.
@mj1856 Do you have any insights on this? I have the same problem as @nicolaidahl and I'm blocked since 3 days. The locale is loaded on the original moment and not the moment used in moment-timezone.
@gabrielalan
This worked for me:
^ before version number ("moment": "2.19.4" in your case)rm -rf your-project/node_modulesyarn
Most helpful comment
No thoughts on this? It's really weird to have 2
momentinstalled on my node_modules.I have the direct dependency for
momentandmoment-timezone. But the last also has a dependency formoment, so what I have is this:Even with the same version, npm install the second dependency. Probably with PeerDependency would solve this problem.