Aris Paskalov
Aris Paskalov

Reputation: 110

Why can't I install the React Native Testing library?

I'm new to app testing and have started delving into this topic since yesterday. I wanted to write tests for my React Native app and tried to install React Native Testing Library with this command:

npm install --save-dev @testing-library/react-native @testing-library/jest-native

Then I ran into the following problem:

enter image description here

I tried to find a solution to this problem in Google, but I did not succeed. As far as I understand, the problem lies in the dependencies? Please tell me what can I do in this case?

P.S. I tried to create a completely clean project with expo init, tried to install the library but got exactly the same error

Upvotes: 2

Views: 1593

Answers (3)

Sumit_VE
Sumit_VE

Reputation: 487

you need to update react version after updating just install the latest version of testing-library

Upvotes: -1

Kia Kaha
Kia Kaha

Reputation: 1781

Hit the same issue and didn't want to update everything at the moment so I solved the issue by running a suggestion on the npm error output:

npm install --save-dev @testing-library/react-native --legacy-peer-deps

It worked for me

Upvotes: 5

Fapi
Fapi

Reputation: 356

it looks like you are running into a conflict with your react version dependencies. Please check the named modules for required packages they depend on. Please have a look with: npm outdated and then maybe try to update your settings via npm update

also take a look here if you want: updating npm dependencies

Upvotes: 0

Related Questions