react-live-clock icon indicating copy to clipboard operation
react-live-clock copied to clipboard

resolve react-moment?

Open Nolanws1 opened this issue 4 years ago • 6 comments

Is there any trick to this?

./node_modules/react-live-clock/lib/Component.js
Module not found: Can't resolve 'react-moment' in '/Users/nolan/clock/node_modules/react-live-clock/lib'

I'm following documentation/ youtube and seem to keep runing into this...

Nolanws1 avatar Jan 12 '21 01:01 Nolanws1

I'm so sorry. I c&p the wrong console error this this the error I am referring to...

./node_modules/react-live-clock/lib/Component.js Module not found: Can't resolve 'moment-timezone' in '/Users/nolan/scratch-react/node_modules/react-live-clock/lib'

Nolanws1 avatar Jan 12 '21 01:01 Nolanws1

You need to have this module installed yarn add moment-timezone or npm install moment-timezone

anthony0030 avatar Jan 12 '21 10:01 anthony0030

Ye this is a bug it ought to be in dependencies , not peer dependencies

damiangreen avatar Jul 20 '22 14:07 damiangreen

it was to fix a problem with the build size ( #40 ). the dependencies go in the peer dependencies so that you can have the version you want and the build will be lighter.

anthony0030 avatar Jul 21 '22 06:07 anthony0030

it means we now have moment and moment-timezone though...

damiangreen avatar Aug 01 '22 19:08 damiangreen

I think the problem is that some of the peer deps are locked down too tight. This is the only package I have ever maintained, and I am doing my best.

@Nolanws1, @damiangreen could you please take a look at https://nodejs.org/en/blog/npm/peer-dependencies

I moved them to peer deps so the package was smaller on build, I don't know why they are not automatically installing or at least giving an error telling you to install

anthony0030 avatar Aug 02 '22 06:08 anthony0030

It also appears it depends on @types/moment-timezone This package is marked as unneeded by PnPm

damiangreen avatar Nov 03 '22 10:11 damiangreen

@damiangreen what do you suggest I do?

anthony0030 avatar Nov 08 '22 16:11 anthony0030

I made some changes I hope it helps

anthony0030 avatar Nov 22 '22 11:11 anthony0030