0

I wish to install the React Native CLI to my Windows 10 x64 PC. Kindly help.

I encounter the following error when I issue this command:

npm install -g react-native-cli

The error I receive:

npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to http://registry.npmjs.org/react-native-cli failed, reason: connect ECONNREFUSED 104.16.21.35:80 - Local (0.0.0.0:2623)
npm ERR!     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
npm ERR!     at ClientRequest.emit (events.js:182:13)
npm ERR!     at Socket.socketErrorListener (_http_client.js:391:9)
npm ERR!     at Socket.emit (events.js:182:13)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:82:8)
npm ERR!     at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
npm ERR!     at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR!  { FetchError: request to http://registry.npmjs.org/react-native-cli failed, reason: connect ECONNREFUSED 104.16.21.35:80 - Local (0.0.0.0:2623)
npm ERR!     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
npm ERR!     at ClientRequest.emit (events.js:182:13)
npm ERR!     at Socket.socketErrorListener (_http_client.js:391:9)
npm ERR!     at Socket.emit (events.js:182:13)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:82:8)
npm ERR!     at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
npm ERR!     at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR!   message:
npm ERR!    'request to http://registry.npmjs.org/react-native-cli failed, reason: connect ECONNREFUSED 104.16.21.35:80 - Local (0.0.0.0:2623)',
npm ERR!   type: 'system',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   stack:
npm ERR!    'FetchError: request to http://registry.npmjs.org/react-native-cli failed, reason: connect ECONNREFUSED 104.16.21.35:80 - Local (0.0.0.0:2623)\n    at ClientRequest.req.on.err (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-fetch-npm\\src\\index.js:68:14)\n    at ClientRequest.emit (events.js:182:13)\n    at Socket.socketErrorListener (_http_client.js:391:9)\n    at Socket.emit (events.js:182:13)\n    at emitErrorNT (internal/streams/destroy.js:82:8)\n    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)\n    at process._tickCallback (internal/process/next_tick.js:63:19)' }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mwaqa\AppData\Roaming\npm-cache\_logs\2018-12-11T14_13_07_498Z-debug.log

1 Answer 1

2

This issue may be related to your proxy, first, try these following commands:

npm config set proxy null
npm config set https-proxy null
npm config set registry http://registry.npmjs.org/

and then execute

npm install -g react-native-cli

hope this will help.

Sign up to request clarification or add additional context in comments.

4 Comments

Do you have any antivirus installed on your system?
No, I even have Windows Defender disabled.
Have you tried executing all commands with admin user right? If not please try.
Yes, I have tried to run from both the CMD and PowerShell as Adminsitrator privileges but it still returns the same error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.