如何在代理后面安装npm?

时间:2018-08-29 06:57:49

标签: react-native npm expo

我阅读了有关此问题的所有内容,但没有一个起作用。

我得到了npm ERR! code E418

npm ERR! network request to http://registry.npmjs.org/expo failed, reason
drinfo ENOTFOUND http http:80
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
gs.
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'

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

如果您知道代理信息:

$ npm config set proxy http://<username>:<password>@<proxy-server-url>:<port>
$ npm config set https-proxy http://<username>:<password>@<proxy-server-url>:<port>