1

I am using expo

I have the following error:

Unable to resolve "@react-native-community/datetimepicker" from "node_modules\react-native-modal-datetime-picker\src\DateTimePickerModal.android.js" ERROR [Error: undefined Unable to resolve module @react-native-community/datetimepicker from F:\CODEBLOCKS\android studio\class_finder\node_modules\react-native-modal-datetime-picker\src\DateTimePickerModal.android.js: @react-native-community/datetimepicker could not be found within the project or in these directories: node_modules

3 | import DateTimePicker from "@react-native-community/datetimepicker"; | ^


I have tried everything to solve it ....I have tried many solves from stack overflow solutions. But none have worked . Is there any alternative way to use datetimepicker ?

I have tried following command to solve this

npm i react-native-modal-datetime-picker @react-native-community/datetimepicker

expo install react-native-modal-datetime-picker @react-native-community/datetimepicker


3 Answers 3

0

Try it with this

react-native link @react-native-community/datetimepicker
Sign up to request clarification or add additional context in comments.

Comments

0

I had the same issue and I managed to solve it by cloning the library from the git repo. In your package.json, add this line under dependencies:

@react-native-community/datetimepicker": "git+https://github.com/react-native-datetimepicker/datetimepicker.git"

then npm i.

Comments

0

I had the same issue! What worked for me was the following in my project directory:

npm install @react-native-community/[email protected]

I personally had to replace @5.1.0 with the specific version I'm using, @6.5.2 -- the terminal will tell you after you run the command if you need to update to a different version.

Big thanks to GitHub user ChuckCassadyJR who had the answer: https://github.com/expo/snack/issues/257

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.