Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error Couldn't find any versions for "react" that matches "latest" in our cache #8294

Closed
erralb opened this issue Jan 8, 2020 · 2 comments
Closed

Comments

@erralb
Copy link

erralb commented Jan 8, 2020

Hi there, I'm trying React for the first time, and I have an installation problem:

$ npx create-react-app react-test
npx: installed 91 in 5.31s

Creating a new React app in /home/pierre/web/react-test.

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

You appear to be offline.
Falling back to the local Yarn cache.

yarn add v1.21.1
[1/4] Resolving packages...
error Couldn't find any versions for "react" that matches "latest" in our cache (possible versions are ""). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact --offline react react-dom react-scripts cra-template --cwd /home/pierre/web/react-test has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting react-test/ from /home/pierre/web
Done.

As suggested in the error, I tried the command without the --offline flag, but then I'm having this network connection issue (I have no problem with my internet connection):

$ yarnpkg add --exact react react-dom react-scripts cra-template --cwd /home/pierre/web/react-test
yarn add v1.21.1
info No lockfile found.
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...

I've then tried various solutions suggested here: yarnpkg/yarn#4890 but nothing solved it.
I've tried to clear the yarn cache. yarn works well on other projects, I only have a problem with this.

Any idea where I could look to find a solution?

Did you try recovering your dependencies?

No dependencies yet...

Which terms did you search for in User Guide?

I read the guide and searched online but couldn't solve the problem.
I am using yarn and npm on other project on my machine and I have no problem

Environment

$ npx create-react-app --info

Environment Info:

System:
OS: Linux 5.3 Fedora 30 (Workstation Edition) 30 (Workstation Edition)
CPU: (4) x64 Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
Binaries:
Node: 10.16.0 - /usr/bin/node
Yarn: 1.21.1 - /usr/bin/yarn
npm: 6.13.4 - /usr/bin/npm
Browsers:
Chrome: 79.0.3945.88
Firefox: 71.0
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: 3.3.0

Steps to reproduce

$ npx create-react-app react-test

Expected behavior

installing

Actual behavior

not installing

Reproducible demo

don't know how

@heyimalex
Copy link
Contributor

That regular yarn install is failing makes me suspect some sort of network firewall or active antivirus is involved. We're literally just shelling out to yarnpkg when we make this call, so it's likely nothing on the CRA side.

I am using yarn and npm on other project on my machine and I have no problem

So what happens when you run this? With the cwd flag adjusted accordingly.

yarnpkg add --exact react react-dom react-scripts cra-template --cwd /home/pierre/web/react-test

@erralb
Copy link
Author

erralb commented Jan 10, 2020

Hi, and thanks for your answer.

This is really weird, today it worked fine, after trying for two consecutive days many times without luck. I understood that create-react-app was shelling yarnpkg, but I wasn't having problems on other projects... I also haven't changed anything in my config... bummer!

@erralb erralb closed this as completed Jan 10, 2020
@lock lock bot locked and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants