1

I want to create a react app although "npx create-react-app [app-name]" won't work in my project folder. I get the an "Incorrect integrity when fetching from the cache" error although I'm not familiar with why it's not fetching. The error is below.

=================================

Vincents-MacBook-Pro:Personal-Projects Vince$ npx create-react-app my-app

Creating a new React app in /Users/Vince/Documents/Coding-Projects/Personal-Projects/my-app.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...

yarn add v1.19.0 [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... error Incorrect integrity when fetching from the cache info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation. yarnpkg add --exact react react-dom react-scripts --cwd /Users/mountainthief/Documents/Coding-Projects/Personal-Projects/test-app has failed.

Deleting generated file... package.json Deleting generated file... yarn.lock Deleting test-app/ from /Users/Vince/Documents/Coding-Projects/Personal-Projects Done.

=================================

I've tried "npm cache clean --force" and uninstalling yarn to no avail.

What could I be missing?

npm cache clean --force uninstall yarn

Creating a new React app in /Users/Vince/Documents/Coding-Projects/Personal-Projects/my-app.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...

yarn add v1.19.0 [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... error Incorrect integrity when fetching from the cache info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation. yarnpkg add --exact react react-dom react-scripts --cwd /Users/mountainthief/Documents/Coding-Projects/Personal-Projects/test-app has failed.

Deleting generated file... package.json Deleting generated file... yarn.lock Deleting test-app/ from /Users/Vince/Documents/Coding-Projects/Personal-Projects Done.

I expected a functional React-app complete with node-modules although I received the error:

yarn add v1.19.0 [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... error Incorrect integrity when fetching from the cache info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

1
  • Seems like yarn cache issue to me. Have you tried yarn cache clean? Commented Oct 7, 2019 at 3:55

5 Answers 5

2

You can also see where the cache is with yarn cache dir.

yarn cache dir

Running yarn cache dir will print out the path where yarn’s global cache is currently stored. When you do a

yarn cache clean

You can check the folder actually cleans. If that fails you can manually delete it. yarn cache documentation

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

1 Comment

For some reason npm uninstall yarn didn't cut it. However, manually looking up and removing yarn did the trick. Thanks!
0

please run both commands again then install your app. Basically this types of error coming due to some package dependencies. So please install all both packages again.

npm install -g create-react-app and reinstall yarn

If you getting same error after install both the please send me yarn and node version. https://www.npmjs.com/package/npx

Comments

0

I had the same issue and it has resolved with upgrading global yarn packages.

$ yarn global upgrade

Comments

0

What fixed it for me was to delete the entire global yarn cache dir in the file system which I got via yarn cache dir, here's a one liner for that:

rm -rf `yarn cache dir`

After that yarn global upgrade made it work again:

yarn create react-app my-app --typescript
Happy hacking!
✨  Done in 22.60s.

Comments

0

This was a simple folder permissions issue for me, a sudo resolved:

sudo npx create-react-app myApp

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.