Yarn: Unable to install react-native project using yarn

Created on 22 Apr 2017  路  30Comments  路  Source: yarnpkg/yarn

This will walk you through creating a new React Native project in E:\startup\tinybag
Using yarn v0.23.2
Installing react-native...
yarn add v0.23.2
info No lockfile found.
[1/4] Resolving packages...
info If you think this is a bug, please open a bug report with the information provided in "E:\startup\tinybag\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

error An unexpected error occurred: "https://registry.yarnpkg.com/react-native: connect ETIMEDOUT 104.16.63.173:443".

Command yarn add react-native --exact failed.

Most helpful comment

$ npm config set registry "https://registry.npmjs.org"
it works for me

All 30 comments

Can you provide your yarn-error.log file? It looks like a network failure.

Yarn-error.log file

Arguments:
G:\Softwares\Node JS\node.exe C:Program Files (x86)\Yarn\bin\yarn.js add react-native --exact

PATH:
C:ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;G:\Softwares\Node JS\;C:Program Files (x86)\Common Files\lenovo\easyplussdk\bin;G:\Softwares\Git\cmd;C:Program Files (x86)\Yarn\bin;C:\Users\Anudeep\AppData\Local\Android\sdk\tools;C:\Users\Anudeep\AppData\Roaming\npm;C:\Users\Anudeep\AppData\Local\Android\sdk\platform-tools;C:\Users\Anudeep\AppData\Local\atom\bin;C:\Users\Anudeep\AppData\Local\atom;C:Program Files (x86)\WinRAR\;C:\Users\Anudeep\AppData\Local\Microsoft\WindowsApps;G:\Softwares\Microsoft VS Code\bin;G:\Softwares\heroku\bin;C:\Users\Anudeep\AppData\Local\Yarn.bin

Yarn version:
0.23.2

Node version:
7.2.0

Platform:
win32 x64

npm manifest:
{"name":"tinybag","version":"0.0.1","private":true,"scripts":{"start":"node node_modules/react-native/local-cli/cli.js start"}}

yarn manifest:
No manifest

Lockfile:
No lockfile

Trace:
Error: connect ETIMEDOUT 104.16.63.173:443
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)

Actually it's showing network timeout but my internet connection is working fine.

Similar Issue #944, #1565

could be an issue at the gate, probably a one-off thing

$ npm config set registry "https://registry.npmjs.org"
it works for me

@kk412027247 thank you for a lot, I solved my problem

@kk412027247 Why does this work? Does Yarn rely on npm's registry?

Just had this problem and @kk412027247 solution worked for me.

I had another problem and @kk412027247 solution also worked for me 馃槀

This Worked For Me . Thanks @kk412027247

This Worked For me. Thanks @kk412027247

npm config set registry "https://registry.npmjs.org" didn't work for me. It changed the error , but I got a timeout error.

I changed ISP and it worked for me.

@kk412027247 that worked for me (but with minor change using only http not https)

$ npm config set registry "http://registry.npmjs.org"
$ npm config set proxy http://{host}:{port}
$ npm config set proxy-https http://{host}:{port}

AND THEN OVER IN YARN (because yarn was still attempting to access https://registry.npmjs.org)
see issue: https://github.com/yarnpkg/yarn/issues/4546

$ yarn config delete https-proxy
$ yarn config set http-proxy http://host:port
$ yarn config set strict-ssl false

@kk412027247 your solution is really appreciated. It works for me too! Thank you!

@kk412027247 this didn't worked for me..
How did i solved it?
Simple,
I uninstalled yarn,
Following are the ways to uninstall yarn
Depends on how you installed it:

brew: brew uninstall yarn

tarball: rm -rf "$HOME/.yarn"

npm: npm uninstall -g yarn

ubuntu: sudo apt-get remove yarn && sudo apt-get purge yarn

debian: yum uninstall yarn

windows: choco uninstall yarn

This Worked For me. Thanks @kk412027247

Guys, this worked for me too! Thank you all so much!

after run it
npm config set registry "https://registry.npmjs.org"
the error is:

chen:ReactNative chen$ react-native init MyProject
This will walk you through creating a new React Native project in /Users/chen/ReactNative/MyProject
Using yarn v1.9.4
Installing react-native...
yarn add v1.9.4
info No lockfile found.
[1/4] 馃攳  Resolving packages...
[2/4] 馃殮  Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version "6.* || 8.* || >= 10.*".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
{ Error: Command failed: yarn add react-native --exact
    at checkExecSyncError (child_process.js:575:11)
    at execSync (child_process.js:612:13)
    at run (/usr/local/lib/node_modules/react-native-cli/index.js:294:5)
    at createProject (/usr/local/lib/node_modules/react-native-cli/index.js:249:3)
    at init (/usr/local/lib/node_modules/react-native-cli/index.js:200:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:153:7)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 9042,
  stdout: null,
  stderr: null }
Command `yarn add react-native --exact` failed.

how to fix it ?

error [email protected]: The engine "node" is incompatible with this module. Expected version "6.* || 8.* || >= 10.*". error Found incompatible module

you have a non compatible node version

I am having the same problem when using node v 9.4.0. No problem when using node v 8.8.1 or v 11.0.0.

@chenweigh i upgrade my node to latest version, and it solved my issues

i upgraded my node and then everything works fine

@chenweigh I was receiving the same error then I realized that I made my folders secret.
( )=>You must not hide folders.

Apparently, uninstalling yarn worked...
Thank you @akamahesh.

Apparently, uninstalling yarn worked...
Thank you @akamahesh.

Same for me!!! Thanks again @akamahesh

I am having the error below and I fix it as @apoku said, configuring the proxy for yarn.

error An unexpected error occurred: "https://registry.npmjs.org/react-native: self signed certificate in certificate chain".
info If you think this is a bug, please open a bug report with the information provided in "C:\Desenv\Android\Projetos\Mobile\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
{ Error: Command failed: yarn add react-native --exact
at checkExecSyncError (child_process.js:637:11)
at execSync (child_process.js:674:13)
at run (C:\Users\sidnei.carneiro\AppData\Roaming\npm\node_modules\react-native-cli\index.js:294:5)
at createProject (C:\Users\sidnei.carneiro\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
at init (C:\Users\sidnei.carneiro\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
at Object. (C:\Users\sidnei.carneiro\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
status: 1,
signal: null,
output: [ null, null, null ],
pid: 43324,
stdout: null,
stderr: null }
Command yarn add react-native --exact failed.

Before updating npm and node first check this URL : https://yarnpkg.com/en/docs/cli/add
if it is not working fine then the issues from admin side.Maybe yarn is blocked at server side.

I am on node 12 but still having the same problem

Was this page helpful?
0 / 5 - 0 ratings