0

I am new to developing react native app. I'm facing problem while installing axios using the command npm install axios in my terminal.

I have tried below code as well to install axios library:

npm install --save axios
npm i axiois --save

So what is the problem why I am not able to get dependencies in my app?

A small request also is install and i are the same in this npm command?

UPDATE
Here is the log that might help you:

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/axios failed, reason: connect ETIMEDOUT 104.16.21.35:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! 

UPDATE 2
As everyone is pointing to a network problem I have tried all the answer and commentes you have provided but nothing works, but I am able to use internet on my PC easily means device in which I am running this command.

npm install axios

on the same device I am using browser, spotify and in terminal I just installed vlc using apt-get install so there is no chance of technical issue. Thank you all for help but nothing working is there any other solution?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Kiran Patel
  • 98
  • 3
  • 12

6 Answers6

0

It is clearly related to your system's network. Try changing your network by creating a hotspot from other devices.

Anurodh Singh
  • 814
  • 5
  • 9
0

Its network related issue make sure u have an active internet connection while installing axiois.

Surya
  • 35
  • 11
0

Try un-installing and then install it again

npm uninstall axios
npm i axios
joy08
  • 9,004
  • 8
  • 38
  • 73
0

check you network connection

after that do system update: 1) sudo apt-get update

try running the command again.

0

Here according to your log it may be your internet connection problem or proxy settings problem.

  • Try to reconnect to the internet and make sure you have active internet connection.

If reconnecting to different internet connection still does not solve your issue try to run this command :

npm cache verify

Check your config settings: npm config list

Then you could add or change your proxy settings:

npm config set http-proxy http://your_proxy_ip:port
npm config set https-proxy http://your_proxy_ip:port

Refer

Refer

Akila Devinda
  • 5,054
  • 3
  • 19
  • 35
0

Connect to hotspot and try installing , worked for me