Getting ETimedOut error when trying to install packages using npm in windows - proxy

I'm facing this "ETimedOut" error when trying to use this command "npm install -g yo" .Actually I'm using a network proxy to access internet.
I got a warning message that "If u are behind a proxy,please make sure that 'proxy' config is set properly ".
Can anyone please help me out regarding this issue.

You can set the npm proxy config parameter using these commands:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
Source

Related

I try to install my dependencies but I got a error

i tried to install dependencies of my program and I get a error when execute yarn install on linux os
i execute "yarn install or sudo yarn install" a i get the next error:
An unexpected error occurred: "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz: connect EACCES 2606:4700::6810:1523:443"
any ideas?
Turn off the strict-ssl on yarn/npm config, and try again
yarn config set "strict-ssl" false -g
or
npm config set "strict-ssl" false -g
or
yarn config set registry https://registry.npmjs.org
try these and then tell me if it worked or not and if solved please accept the answer
finnaly was only firewall rule of ubuntu.
sudo ufw allow 443

Can't run npm commands behind a proxy

I'm using npm behind a proxy which doesn't requires username and password, I've tried all different commands but without any result, the internet connection is working fine on command line , here's is the command I've used :
- npm config set proxy http://10.23.201.11:3128
- npm config set https-proxy http://10.23.201.11:3128
- npm config set registry https://registry.npmjs.org/
- npm config set strict-ssl false
- npm config set bin-links false
** These are the errors I'm getting when trying to run an npm command :
example : npm install -g react-native-cli
- npm rollback failed
- npm ERR! code E502
- 502 Bad Gateway: react-native-cli#latest

Thingsboard Not building from Source

I have a new ubuntu 16.04 Virtual machine that I'm attempting to install thingsboard on using this documentation Contribution Guide and am not having any success:
This is what did did on the machine:
sudo apt-get install default-jre default-jdk
Export JAVA_HOME='/usr/lib/jvm/default-java'
git clone https://github.com/thingsboard/thingsboard.git
git checkout release-1.3
cd ${TB_WORK_DIR}/application
mvn clean install -DskipTests
Modified cd ${TB_WORK_DIR}/application/target/bin/install/install_dev_db.sh to my user and executed script.
I would like to use HSQLDB at the moment.
cd ${TB_WORK_DIR}/application
mvn clean install -DskipTests
Results:
NPM server starts but when I log onto localhost:3000 and attempt to login with tenant#thingsboard.org / tenant, I get the error
[Error API proxy error: Error connect ECONNREFUSED 127.0.0.1:8080]
I've triple checked that I do not have a typo.
Am I missing a step?
I'm not using a proxy and received the same error as above:
npm config set proxy null
npm config set https-proxy null npm config
npm config set registry http://registry.npmjs.org/
cat ~/.npmrc:
proxy=null
https-proxy=null
registry=http://registry.npmjs.org/ls
As you noted, this is the same as thingsboard/thingsboard issue 336...
with the only tip being:
I think you need the backend running in order to be able to log in.
Either you are behind a proxy
npm config set proxy http://myproxyblabla:myport
npm config set https-proxy http://myproxyblabla:myport
Or you are not, meaning your localhost thingsboard system should not use a proxy at all:
npm config set proxy null
npm config set https-proxy null
In both cases:
npm config set registry http://registry.npmjs.org/
Then try again to re-start your server and to log on.
Try this
1- make sure you have java 8 (JDK not JRE) ,
2- Run "mvn clean install -DskipTests" from root directory (not application directory)
3- hit 127.0.0.1:8080 not :3000 (this one if you build from UI folder)

ETIMEDOUT Error while installing Node packages on Windows

I am trying to install node packages on my windows machine using npm from a fresh install of node.
however, I am getting ETIMEDOUT errors. I checked few other stackoverflow questions with similar problem and almost all of them are related to problems when behind a proxy. Same is not the case with me. My system is not behind any proxy server. Can someone help me with resolving it.
PS C:\windows\system32> npm -v
2.5.1
PS C:\windows\system32> npm install bower -g
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i
nstall" "bower" "-g"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect
npm ERR! network connect ETIMEDOUT
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! C:\windows\system32\npm-debug.log
I am posting this answer in case some one faces the same issue.
I was able to solve this by running following command:
npm config delete proxy
First, run
npm config list
and check whether you are behind a proxy. If so, try running
npm config delete proxy
npm config delete http-proxy
npm config delete https-proxy
as required
**If this method did not work, reinstall nodejs.
I tried all the suggested solutions I could find on GitHub forums and StackOverflow topics. Finally disabling my router's firewall solved the issue immediately.
I am using Windows 10, node 4.0.0 and npm 2.13.4.
First see the npm config list:
npm config list
If you don't find http-proxy, https-proxy and proxy correctly set, then
You need to configure npm to work with your web proxy. For example:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
npm config set http-proxy http://proxy.company.com:8080
Not on Windows but it can help there as well.
Node 16 worked, Node 18 did not. Turns out it was related to IPv6. As soon as I disabled IPv6 the connection did not timeout any more. The target registry was a Nexus server.
You can try to throttle the number of simultaneous connections with the following command (for example 3 maximum simultaneous connections):
npm set maxsockets 3
The CLI has been allowing this option since npm#3.8.0. The default is 50 simultaneous connections max. See this link for further reference.
If removing the npm proxy config settings (or correctly setting them, if that is necessary for you) did not fix it, then This github issue discusses what might be happening. My summary is that for some reason the ipv6 dns resolution to the registry is not resolving correctly and seems to be randomly failing for people.
My command was fetching from registry.npmjs.org using npm 9.1.2 and node 18.12.1 - I was running this from a windows terminal via vscode.
I ended up disabling ipv6 via the network properties of my adapter see here
Again, changing the npm config proxy settings did not resolve anything for me. I re-enabled ipv6 after my command finished.
For people working in corporates (where you cannot delete or edit the proxy configuration of the organization):
There must be an .npmrc file in your users folder. If not, you can create one. This file can be edited to register the proxy settings of your organization. Contact your organization's IT team to get the relevant proxy details.
Example of the .npmrcfile contents for my organization:
strict-ssl=false
registry=https://nexus.com/nexus/content/groups/npm-read/
proxy=http://primary-proxy.gslb.intranet.com:8080/
https-proxy=http://primary-proxy.gslb.intranet.com:8080
This file can be found in your users folder:
I was not able to install any packages before because of this error then after 1 hour, I finally resolved it because I was not behind a proxy but the proxy parameters got set in the npm config thats why that error was showing.
I'am posting it because if anyone is facing the same issue and if they are not behind any proxy then they can use the following commands:-
npm config rm proxy
npm config rm https-proxy
npm config delete http-proxy
npm config delete https-proxy
set HTTP_PROXY=null
set HTTPS_PROXY=null
One way to resolve this is to set Fiddler as your proxy server. This probably only works for windows.
Running Fiddler, type these commands:
npm config set proxy http://localhost:8888
npm config set https-proxy http://localhost:8888
Before you do this, Rules -> Automatically Authenticate
I solved with:
npm config set proxy null
I solved it with the following:
npm config rm proxy
npm config rm https-proxy
npm config delete http-proxy
npm config delete https-proxy
set HTTP_PROXY=null
set HTTPS_PROXY=null
I was going through the same error. the root cause was the proxy settings : there are several answers provided in here to reset the proxy but none of them worked for me.
Below commands solved my problem, give them a try.
npm config rm proxy
npm config rm https-proxy
If none of the mention solutions works for you then, try switching your node version.
I tried to implement all solutions and suggested commands for npm and yarn but it's not resolved.
When I disable my VPN and try to "yarn install, " it will work fine.
After all the effort with no result, I reboot my router and it works!
On windows 10, adding Node.js to the firewall authorized applications AND restarting the laptop solved the problem.
I also face this issue
Solution
Just uninstall Node.js .
uninstall its package also which you downloaded from website.
Download Node.js from website.
Reinstall Node.js .
It will Work.

Can't delete npm proxy

In work I have a proxy and set this in npm
npm config set proxy http://theproxy:8080
npm config set https-proxy https://theproxy:8080
Out of work I don't have the proxy and need to remove it in npm.
I've tried
npm config rm proxy
npm config rm https-proxy
and
npm config delete proxy
npm config delete https-proxy
but when I use
npm config get proxy
npm config get https-proxy
the proxy is still there
How do I remove the proxy in npm
Below things worked for me, make sure environment variable HTTP_PROXY is unset before removing config entries
Unsetting HTTP_PROXY= is very important
set HTTP_PROXY=
npm config rm proxy
npm config rm https-proxy
npm config rm http-proxy
It works very well for me ..
saidas-mbp:trunk saidababuchanda$ npm config set proxy https://www.google.com
saidas-mbp:trunk saidababuchanda$ npm config get proxy
https://www.google.com
saidas-mbp:trunk saidababuchanda$ npm config delete proxy
saidas-mbp:trunk saidababuchanda$
saidas-mbp:trunk saidababuchanda$ npm config get proxy
null
saidas-mbp:trunk saidababuchanda$ npm -v
1.4.14
saidas-mbp:trunk saidababuchanda$
Please look at your npm version
Try this
npm config delete proxy
npm config delete proxy -g
npm config delete https-proxy
npm config delete https-proxy -g
In my case the issue was trying to delete the proxy while I was in specific folder project that contains .npmrc file.
Inside the file there was proxy definition for this specific folder.
So I removed the proxy definition inside.
I doubt , it is set somewhere in your npmrc files , can you check below files?to see if this value is set somewhere.
npmrc Files
The four relevant files are:
per-project config file (/path/to/my/project/.npmrc)
per-user config file (~/.npmrc)
global config file ($PREFIX/npmrc)
npm builtin config file (/path/to/npm/npmrc)
npm config rm proxy
npm config rm https-proxy
npm config rm http-proxy
I think your issue is you need to remove it globally. Try:
npm config rm proxy -g
npm config rm https-proxy -g
Three steps solution.
What worked for me is setting the proxy to an empty string / url, then I used npm config delete to remove the https-proxy setting.
So i ran the following commands:
npm config set proxy
npm config delete https-proxy -g
Additionally you can run npm config list to verify that the values indeed have been removed.
Now one last thing, you need to run the following command:
npm config edit
A file will open on your default text editor, in that file remove any proxy configurations added by you.
I tried all the solutions in this thread but it didn't work. The issue was that proxy settings were commented in my "C:\Users\YOURNAME.npmrc" file. Uncommenting it worked for me.
proxy=null
https-proxy=null

Resources