stephy / CalendarPicker

CalendarPicker Component for React Native
803 stars 373 forks source link

npm i {dependency} does not work after calendarPicker #217

Closed richardszanyi closed 4 years ago

richardszanyi commented 4 years ago

Today I was needed to install another dependancy to our project. Hence, I used: image

Then, I was ok - then I'll just remove node_modules, and install then. I did, npm i worked with safe-area-context, it is added to package.json. Okay, I was like now I can use npm i to resolve the rest of the dependancies:

image

So I removed node_modules again, then ran 'npm i'.

It worked, and dependencies are resolved.

It concerns me that somehow calendar-picker bugs out with npm dependency resolve, and cannot install any more after installing it.

peacechen commented 4 years ago

Thanks for reporting this issue. Do you have a history of the exact versions of react-native-calendar-picker installed? Depending on the type of version specified in package.json, package-lock.json or yarn.lock would record specific versions. Older versions of either react-native-calendar-picker or its dependency node-git-hooks had a bug that may be related. To confirm this, would you test adding another new package?

richardszanyi commented 4 years ago

package-lock has a version 6.1.2, as well as package.json specified. New package adding is throwing error still: image

peacechen commented 4 years ago

The git hooks installation was fixed in 6.1.5. I recommend that you upgrade to 7.0.0 and delete package-lock to ensure that all its dependencies are up to date.

richardszanyi commented 4 years ago

Jegyzet_2020-07-22_124033 This is with 7.0.0

peacechen commented 4 years ago

That sounds like a stale cache issue. Use these steps to clear the cache:

  1. Delete node_modules.
  2. npm install
  3. npm start -- --reset-cache
  4. Break out of that after it starts the packager: Ctrl-C.
  5. Start the app with npm start (or react-native run-... for native projects).

The --reset-cache flag requires @react-native-community/cli-tools:

npm install @react-native-community/cli-tools --global

In the future, please paste the logs as text instead of a screenshot. That makes it easier to copy/paste the contents to search.