0

I am trying to create new app with create-react-app.
Below is the error.
Please help. Thanks in advance

➜ REACT create-react-app my-app

Creating a new React app in /media/budi/Tjung/#TJUNG/REACT/my-app.

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...
error An unexpected error occurred: "http://registry.npmjs.org/react: > ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/media/budi/Tjung/#TJUNG/REACT/my-app/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 --cwd /media/budi/Tjung/#TJUNG/REACT/my-app has failed.

Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting my-app / from /media/budi/Tjung/#TJUNG/REACT
Done.

error image at CLI

tjungChaniago
  • 196
  • 1
  • 9
  • Try `npm config set registry http://registry.npmjs.org/` and see if that works. – Colin Ricardo Apr 19 '18 at 11:25
  • look at https://github.com/facebook/create-react-app/issues/576 – Santosh Sharma Apr 19 '18 at 11:28
  • @Colin ... I have tried it and also try this `npm config set registry https://registry.npmjs.org/` , its output same error. – tjungChaniago Apr 19 '18 at 11:30
  • @SantoshSharma ... I have npm and yarn installed with the latest version. when i type `create-react-app ` , its automatically use yarn to create new app. I have tried remove my yarn, create react app with npm, takes long time (30 minutes) still not finish created. – tjungChaniago Apr 19 '18 at 11:37

5 Answers5

1

Looks like network problem to me. You could be behind a proxy. If that is the case, configure your proxy in npm like this

npm config set proxy http://proxy_host:port

For https

npm config set https-proxy http://proxy.company.com:8080

Note: The https-proxy doesn't have https as the protocol, but http.

Optionally you can also try,

npm config set strict-ssl false

Checkout this SO answer

Hokagoka
  • 139
  • 3
0

check if npm exists on your system.

try the commands in this order. 1. npm install --save create-react-app 2. create-react-app projectname

The name of the project must be in lowercase

Erick
  • 1,098
  • 10
  • 21
0

Assuming that you have Node installed, you can use npm to install the create-react-native-app command line utility:

npm install -g create-react-native-app

Then run the following commands to create a new React Native project called "my-app":

create-react-native-app my-app

cd my-app
npm start
Vu Luu
  • 29
  • 3
0

I have solve this problem.. it is about internet speed connection. . When I met this problem, I have spent one day to find out the solution. I read so many article about ETIMEDOUT. I had uninstall and re-install npm and yarn. Still doesn't solve my problem. . Until then I found the spot that has high speed internet connection. Fortunately I can create new app with create-react-app.

tjungChaniago
  • 196
  • 1
  • 9
0

I think there are problem with your configurations of npm package.

Maybe somewhere, you set up some proxy configuration to npm variables.

You can reset configs running this script in terminal

sudo sh -c 'echo "" > $(npm config get globalconfig)'

and wait until process will end and run

exit

Open another terminal window and try

Tasos K.
  • 7,979
  • 7
  • 39
  • 63