D
D
darktowerk56c2019-09-10 15:23:35
React
darktowerk56c, 2019-09-10 15:23:35

How to fix error after installing jest?

Hello. In the create-react-app application, I set in package.json:
npm install --save-dev jest
and then I run the command:
npm run start
This is the error. Can you please tell me how to resolve this error?
5d7795c4a9886215286032.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Demian Smith, 2019-09-10
@search

You now have 2 files: package-lock.json and yarn.lock. There must be one. Most likely yarn.lock, because react projects prefer yarn.
You need to:
1. Remove jest from devDependencies
2. Remove package-lock.json
3. Run `yarn add -D jest` in order to add jest in the way that create-react-app expects you to.
Actually, this is exactly what is written in message that is displayed when the application starts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question