22

I already have an application created with create-react-app package. I found a bug with the version of Jest which is 15.1.1. But I realized that in version 16 the bug is gone.

How to update Jest?

My problem is in the package.json of application there is no Jest package.

Jest is in other folder: node_modules/react-scripts.

2 Answers 2

14

Create React App updates its dependencies once they are stable enough. This usually means waiting a week or two after the new release.

We don't recommend updating anything by yourself unless this is absolutely critical. If you choose to eject to update something we recommend making it a single commit so that you can revert it later once Create React App uses that version internally.

Sign up to request clarification or add additional context in comments.

4 Comments

Currently Create React App uses Jest 24, which is a year old. Is one week not a thing anymore?
When can we expect CRA to start using Jest 26?
This doesn't answer the question. Wait a week and then do what?
create-react-app is kind of abandoned. github.com/facebook/create-react-app/issues/13503
9

The following commands are going to get the job done:

npm run eject
npm install --save-dev [email protected]

But be careful here! The eject command irreversibly eliminates the abstraction layer of create-react-app exposing all of the dependencies and configuration to you. Though, your app is going to work just like before. You'll just have total control upon it, including the ability to update dependencies.

1 Comment

Ran npm install --save-dev [email protected] without doing eject, so best to try without it first, for more recent versions of React. Upvoted, thanks!

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.