React-native project creation is always resulting in error

I downloaded the latest WebStorm yesterday.  I have tried to create a react-native project 5 times but it ends up with same error every time.  It keeps saying "There appears to be trouble with your network connection. Retrying..." even though my laptop is connected to the internet since I am viewing a YouTube video on react-native while the project is being created.

Is this a bug or I am missing something?

The full error output in Run window is as below. Also the yarn-error.log is uploaded: Upload id: 2020_08_11_NNcY6PStLhDZXTfN (file: yarn-error.log)

warning react-native > @react-native-community/cli > metro-core > jest-haste-map > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#dep
recated
[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/rxjs/-/rxjs-5.5.12.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\SUNIL\\WebstormProjects\\untitled\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
info There appears to be trouble with your network connection. Retrying...
Error: Command failed: yarn add react-native --exact
at checkExecSyncError (child_process.js:630:11)
at execSync (child_process.js:666:15)
at run (C:\Users\SUNIL\AppData\Roaming\npm-cache\_npx\19656\node_modules\react-native-cli\index.js:294:5)
at createProject (C:\Users\SUNIL\AppData\Roaming\npm-cache\_npx\19656\node_modules\react-native-cli\index.js:249:3)
at C:\Users\SUNIL\AppData\Roaming\npm-cache\_npx\19656\node_modules\react-native-cli\index.js:217:7
at C:\Users\SUNIL\AppData\Roaming\npm-cache\_npx\19656\node_modules\react-native-cli\node_modules\prompt\lib\prompt.js:316:32
at C:\Users\SUNIL\AppData\Roaming\npm-cache\_npx\19656\node_modules\react-native-cli\node_modules\async\lib\async.js:142:25
at assembler (C:\Users\SUNIL\AppData\Roaming\npm-cache\_npx\19656\node_modules\react-native-cli\node_modules\prompt\lib\prompt.js:313:9)
at C:\Users\SUNIL\AppData\Roaming\npm-cache\_npx\19656\node_modules\react-native-cli\node_modules\prompt\lib\prompt.js:322:32
at C:\Users\SUNIL\AppData\Roaming\npm-cache\_npx\19656\node_modules\react-native-cli\node_modules\prompt\lib\prompt.js:597:5 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 19752,
stdout: null,
stderr: null
}
Command `yarn add react-native --exact` failed.
Done

3 comments
Comment actions Permalink

You will face the same issue when running this command in terminal, I believe... See https://stackoverflow.com/questions/54818471/react-native-init-gives-esockettimedout-error for possible workaround

0
Comment actions Permalink

Is it possible to not add yarn but instead use npm in a WebaStorm react-native project? Then I will not get this timeout error.

0
Comment actions Permalink

You can try choosing npm as a package manager in new project settings (File > New Projects Settings > Settings for New Projects..., Languages & Frameworks | Node.js and NPM)

0

Please sign in to leave a comment.