Create-react-app: can't create-react-app

Created on 14 Jun 2018  路  12Comments  路  Source: facebook/create-react-app

Environment = Windows 10

npx create-react-app projectname

Paste the output of the command in the section below.
-->

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

yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
warning react-scripts > jest > jest-cli > istanbul-api > [email protected]: 1.2.0 should have been a major version bump
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000855.tgz: ESOCKETTIMEDOUT".

Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd C:\Users...\reduxpractice has failed.

Deleting generated file... package.json
Deleting generated file... yarn-error.log

Most helpful comment

npm uninstall -g create-react-app
npm uninstall -g yarn
npm cache clean --force
npm install -g create-react-app
create-react-app cool-projecy-name

Not sure if the uninstall of create-react-app and cache clean is needed but this is what worked for me.

All 12 comments

Did you check your internet connection? Appears to be an issue with you not having internet or a proxy blocking access to the internet.

Same here

yarn add v1.7.0
info No lockfile found.
[1/4] Resolving packages...
warning react-scripts > jest > jest-cli > istanbul-api > [email protected]: 1.2.0 should have been a major version bump
[2/4] Fetching packages...
warning There appears to be trouble with our server. Retrying...
error An unexpected error occurred: "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz: Request failed \"503 Service Unavailable\"".
Aborting installation.

Deleting generated file... package.json
Deleting generated file... yarn-error.log

Same, WIndows 10 WSL, npm 6.1:

yarn add v1.6.0 (node:2656) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. info No lockfile found. [1/4] Resolving packages... warning react-scripts > jest > jest-cli > istanbul-api > [email protected]: 1.2.0 should have been a major version bump [2/4] Fetching packages... info There appears to be trouble with your network connection. Retrying... info There appears to be trouble with your network connection. Retrying... info There appears to be trouble with your network connection. Retrying... info There appears to be trouble with your network connection. Retrying... error An unexpected error occurred: "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz: socket hang up". info If you think this is a bug, please open a bug report with the information provided in "/mnt/..../yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Can reproduce, have yet to find a fix. Works fine with NPM.

Environment

  • Windows 10 1803 17134.112 x64
  • Node 8.11.3 or 10.4.1
  • Yarn 1.6.0 or 1.7.0 or 1.9.0-20180614.1132
  • Network: Wired, No Proxy, 20ms Ping, 94Mbps Download, 11Mbps Upload, 1.1.1.1 DNS

Attempted Fixes

  • Reinstalling Yarn and Node (multiple versions)
  • Admin Terminal (PowerShell)
  • Clearing Yarn and NPM Cache
  • Reinstalling (globally) create-react-app
  • Clearing DNS Cache
  • Restarting PC

Verbose Output

...
verbose 65.602 Performing "GET" request to "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz".
verbose 65.603 Performing "GET" request to "https://registry.yarnpkg.com/react-dom/-/react-dom-16.4.1.tgz".
verbose 65.613 Performing "GET" request to "https://registry.yarnpkg.com/react-scripts-ts/-/react-scripts-ts-2.16.0.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 78.42 Performing "GET" request to "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 96.48 Performing "GET" request to "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz".
verbose 112.552 Error: http://registry.npmjs.org/compression/-/compression-1.7.2.tgz: socket hang up
    at createHangUpError (_http_client.js:313:15)
    at Socket.socketOnEnd (_http_client.js:416:23)
    at Socket.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1081:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
error An unexpected error occurred: "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz: socket hang up".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\Ethan\\Documents\\Elite\\Frontend\\web\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts-ts --cwd C:\Users\Ethan\Documents\Elite\Frontend\web --verbose has failed.

Deleting generated file... package.json
Deleting generated file... yarn-error.log
Done.

I had the same issue installing with windows but I just cloned the project with git clone <repo url> projectname.

Fixed, worked for me:

  • [x] Uninstall the global module create-react-app
  • [x] Clear npm cache
  • [x] Reinstall create-react-app

Linking dependecies last like 40 min, but maybe it's only my hdd

Still an issue for me unfortunately, even after following those steps 馃槙

This should not be marked closed, Yarn still fails.

"npm cache clean --force" solved my problem

Hi @NoiseEee. I think this issue was closed since the root of the problem was the antivirus software running as @tzarebczan stated in his link.

npm uninstall -g create-react-app
npm uninstall -g yarn
npm cache clean --force
npm install -g create-react-app
create-react-app cool-projecy-name

Not sure if the uninstall of create-react-app and cache clean is needed but this is what worked for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fson picture fson  路  3Comments

barcher picture barcher  路  3Comments

adrice727 picture adrice727  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

jnachtigall picture jnachtigall  路  3Comments