How to install npm behind proxy? - react-native

I read all the stuff about this problem but none of them worked.
I got npm ERR! code E418
or
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'
How can I solve this problem?

if you know the proxy informations:
$ npm config set proxy http://<username>:<password>#<proxy-server-url>:<port>
$ npm config set https-proxy http://<username>:<password>#<proxy-server-url>:<port>

Related

npm install takes forever, says I am behind a proxy

I am trying to install different packages using npm 8.19.2. For example yarn
sudo npm install --global yarn
All I get is
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/yarn failed, reason: connect ETIMEDOUT 2606:4700::6810:1823: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! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-12-08T20_14_13_653Z-debug-0.log
I have a fresh installation of Ubuntu 22.04. According to this: http://www.amibehindaproxy.com/ I am not behind a proxy. I do not understand why I should be either. In fact, I don't know what it is.
node --version
v18.12.1
My goal is to get started with react. First step is to just run npx create-react-app my-app. But that does not work.
wget was also slow, then I found this Slow wget speeds when connecting to https pages.
Updating the network settings and disabling IPv6 did the trick.

getting error while npm install .how to solve this on ubuntu 18.04

npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
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! A complete log of this run can be found in:
npm ERR! /home/samsi/.npm/_logs/2022-02-22T05_39_16_188Z-debug-0.log

Not able to change npm proxy settings

I was trying to install ExpressJs from npm was using the command:
npm i express
But I got the following error:
npm ERR! Linux 4.15.0-50-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i" "express"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ECONNRESET
npm ERR! network tunneling socket could not be established, cause=connect ETIMEDOUT 10.7.0.1:8080
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is 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! Please include the following file with any support request:
npm ERR! /home/akhil/npm-debug.log
I suspect it is a proxy error. I use previously working under proxy (mentioned in the error 10.7.0.1:8080) but now I didn't want the proxy and was trying to remove it, for the I have tried the commands:
npm config rm proxy
npm config rm https-proxy
I have also tried adding -g to the above commands
Also I have used,
set HTTP_PROXY=null
set HTTPS_PROXY=null
When I use the command
npm config ls -l
It shows both proxy and https-proxy equal to null. But it seems the proxy has not actually changed looking at the error.
Any help on how to deal with this error would be appreciated.
First, set your proxy false
npm config set proxy false
After that clean your cache
npm cache clean
If that didn't help you and you are using proxy then try this:
npm config set proxy http://proxyhost:proxyport
npm config set https-proxy http://proxyhost:proxyport

I can't install any npm package

I keep getting this error every time I try to install npm package :
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/json-server failed, reason: getaddrinfo ENOTFOUND proxy.company.com proxy.company.com:8181
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! A complete log of this run can be found in:
npm ERR! ```
Seems you've misconfigured your proxy infos, here's how to configure it for npm from your cli :
npm config set proxy http://{user}:{password}#{proxy-url}:{proxy-port}
npm config set https-proxy http://{user}:{password}#{proxy-url}:{proxy-port}
and if you're not behind a proxy :
npm config delete proxy
npm config delete https-proxy
hope it can help.

Unable to install any modules (nodes) in Node-RED on hassio

I am unable to install any modules (nodes) in Node-RED on hassio running on a Raspberry Pi. It worked previously, but does not now. I have not changed any configuration although it is possible that node-red auto updated. When I attempt to install, I get this error:
npm info it worked if it ends with ok
npm info using npm#5.6.0
npm info using node#v10.0.0
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/node-red-contrib-telegrambot-home failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org: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! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-04-30T01_39_51_895Z-debug.log
There is no proxy. I tried to edit package.json to add the modules to dependencies but that also did not work.
It was a DNS problem. Pi-Hole was also running on the RPi and causing the issue. Set DNS to Google using this info.