This repository has been archived by the owner. It is now read-only.

NPM behind a proxy #9401

Closed
hariiharant opened this Issue Aug 25, 2015 · 43 comments

Comments

Projects
None yet
@hariiharant

hariiharant commented Aug 25, 2015

Hello,

There are multiple posts related to the same but none of them solve the problem i have. Its the same old NPM behind corporate proxy:

# npm --https-proxy=http://my-proxy:9090 install -d express --save --registry http://registry.npmjs.org/
npm info it worked if it ends with ok
npm info using npm@2.11.3
npm info using node@v0.12.7
npm WARN package.json myrestful@1.0.0 No repository field.
npm WARN package.json myrestful@1.0.0 No README data
npm info attempt registry request try #1 at 3:33:13 PM
npm http request GET http://registry.npmjs.org/express
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm info attempt registry request try #2 at 3:33:44 PM
npm http request GET http://registry.npmjs.org/express
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm info attempt registry request try #3 at 3:35:06 PM
npm http request GET http://registry.npmjs.org/express
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" "--https-proxy=http://my-proxy:
9090" "install" "-d" "express" "--save" "--registry" "http://registry.npmjs.org/
"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
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 settin
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'

Appreciate any help on this.

Thanks.

@brunowego

This comment has been minimized.

brunowego commented Aug 25, 2015

Try test it checking the address of the repository if is not blocked on your network.

Always check settings:

npm config list

My settings behind a proxy:

npm config set registry http://registry.npmjs.org/
npm config set http-proxy http://username:password@ip:port
npm config set https-proxy http://username:password@ip:port
npm set strict-ssl false

I hope this helps.

@hariiharant

This comment has been minimized.

hariiharant commented Aug 26, 2015

Thanks! I tried it too and it made no difference, here is what happens:

npm install -d express
npm info it worked if it ends with ok
npm info using npm@2.11.3
npm info using node@v0.12.7
npm info attempt registry request try #1 at 2:42:24 PM
npm http request GET http://registry.npmjs.org/express
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
npm info attempt registry request try #2 at 2:42:55 PM
npm http request GET http://registry.npmjs.org/express

Not sure what is happening. Strangely when i connect through my VPN client things are good without even having to set the proxy details in the config...

@wowbruce

This comment has been minimized.

wowbruce commented Aug 27, 2015

brunowego, your answer prefectly help me ! thks!!!

@alansouzati

This comment has been minimized.

alansouzati commented Aug 28, 2015

👍 I faced exactly this issue today (during a live demo to a bunch of people 😢 ).

I used to do npm config set http-proxy http://proxy.address:proxy.port and npm config set https-proxy http://proxy.address:proxy.port and everything worked fine.

Today it just did not work. After investigating it a lot, it seems that npm is not reading http-proxy and https-proxy keys anymore, I could not find anything about deprecating these keys.

The only way I made it work was adding the proxy key like below:

npm config set proxy http://proxy.address:proxy.port

Any thoughts here? I'm using NPM 2.11.3.

@KenanY

This comment has been minimized.

Member

KenanY commented Aug 28, 2015

@alansouzati As far as I know, http-proxy has never been an actual npm config property. proxy and https-proxy should still be working, otherwise there's a bug somewhere.

@alansouzati

This comment has been minimized.

alansouzati commented Aug 28, 2015

thanks @KenanY . Interesting that I've been using this key forever and never faced this issue until today. Even yesterday I was preparing for my meeting and got it working. Anyways maybe I had HTTP_PROXY set in my environment and NPM read it from there.

@snopeks snopeks self-assigned this Sep 30, 2015

@snopeks

This comment has been minimized.

Contributor

snopeks commented Sep 30, 2015

Hi, @hariiharant. Based on the fact that you can install through your VPN but not without it still points to a proxy situation. Are you able to view http://registry.npmjs.org/express in your browser? If yes, there's most likely a proxy configuration issue going on. Let me know what you find out!

@snopeks

This comment has been minimized.

Contributor

snopeks commented Nov 12, 2015

@hariiharant closing since we haven't heard back from you. Let me know if this is still an issue.

@snopeks snopeks closed this Nov 12, 2015

@hariiharant

This comment has been minimized.

hariiharant commented Dec 16, 2015

Sorry for the delayed response. Here is what happened:

The fact i am able to view http://registry.npmjs.org/express in browser had side tracked my attention and took the troubleshooting in some direction but the actual problem turned out to be that i used a wrong proxy server.. bummer.

Thanks for all your inputs. Appreciate it!

@saritseal

This comment has been minimized.

saritseal commented May 12, 2016

for me it worked without the username and password in the proxy settings

@guymalka

This comment has been minimized.

guymalka commented May 31, 2016

after configure proxy im getting ( i can enter the link http://registry.npmjs.org/express )
55 error npm v2.11.3
56 error code ECONNREFUSED
57 error errno ECONNREFUSED
58 error syscall connect
59 error Error: connect ECONNREFUSED
59 error at exports._errnoException (util.js:746:11)
59 error at TCPConnectWrap.afterConnect as oncomplete
59 error { [Error: connect ECONNREFUSED]
59 error code: 'ECONNREFUSED',
59 error errno: 'ECONNREFUSED',
59 error syscall: 'connect' }
60 error If you are behind a proxy, please make sure that the
60 error 'proxy' config is set properly. See: 'npm help config'
61 verbose exit [ 1, true ]

any help

@tapiwa20

This comment has been minimized.

tapiwa20 commented Jun 29, 2016

same with me and i tried the following:

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

@daviswei

This comment has been minimized.

daviswei commented Jul 7, 2016

npm-debug.log file content

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'vue-cli' ]
2 info using npm@2.15.8
3 info using node@v4.4.7
4 verbose install initial load of C:\Users\weidavis\AppData\Roaming\npm\package.json
5 verbose readDependencies loading dependencies from C:\Users\weidavis\AppData\Roaming\npm\package.json
6 silly cache add args [ 'vue-cli', null ]
7 verbose cache add spec vue-cli
8 silly cache add parsed spec Result {
8 silly cache add raw: 'vue-cli',
8 silly cache add scope: null,
8 silly cache add name: 'vue-cli',
8 silly cache add rawSpec: '',
8 silly cache add spec: 'latest',
8 silly cache add type: 'tag' }
9 silly addNamed vue-cli@latest
10 verbose addNamed "latest" is being treated as a dist-tag for vue-cli
11 info addNameTag [ 'vue-cli', 'latest' ]
12 silly mapToRegistry name vue-cli
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry data Result {
15 silly mapToRegistry raw: 'vue-cli',
15 silly mapToRegistry scope: null,
15 silly mapToRegistry name: 'vue-cli',
15 silly mapToRegistry rawSpec: '',
15 silly mapToRegistry spec: 'latest',
15 silly mapToRegistry type: 'tag' }
16 silly mapToRegistry uri https://registry.npmjs.org/vue-cli
17 verbose addNameTag registry:https://registry.npmjs.org/vue-cli not in flight; fetching
18 verbose request uri https://registry.npmjs.org/vue-cli
19 verbose request no auth needed
20 info attempt registry request try #1 at 10:17:42
21 verbose request id 3cc81112d9263195
22 http request GET https://registry.npmjs.org/vue-cli
23 info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:10080
24 info attempt registry request try #2 at 10:17:53
25 http request GET https://registry.npmjs.org/vue-cli
26 info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:10080
27 info attempt registry request try #3 at 10:18:54
28 http request GET https://registry.npmjs.org/vue-cli
29 verbose stack Error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:10080
29 verbose stack at ClientRequest.onError (C:\Program Files\nodejs\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:176:17)
29 verbose stack at ClientRequest.g (events.js:260:16)
29 verbose stack at emitOne (events.js:77:13)
29 verbose stack at ClientRequest.emit (events.js:169:7)
29 verbose stack at Socket.socketErrorListener (_http_client.js:267:9)
29 verbose stack at emitOne (events.js:77:13)
29 verbose stack at Socket.emit (events.js:169:7)
29 verbose stack at emitErrorNT (net.js:1269:8)
29 verbose stack at nextTickCallbackWith2Args (node.js:442:9)
29 verbose stack at process._tickCallback (node.js:356:17)
30 verbose cwd C:\Users\weidavis
31 error Windows_NT 6.1.7601
32 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "vue-cli"
33 error node v4.4.7
34 error npm v2.15.8
35 error code ECONNRESET
36 error network tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:10080
36 error network This is most likely not a problem with npm itself
36 error network and is related to network connectivity.
36 error network In most cases you are behind a proxy or have bad network settings.
36 error network
36 error network If you are behind a proxy, please make sure that the
36 error network 'proxy' config is set properly. See: 'npm help config'
37 verbose exit [ 1, true ]

@kul1010

This comment has been minimized.

kul1010 commented Jul 19, 2016

Use below command at cmd or GIT Bash or other prompt

$ npm config set proxy "http://192.168.1.101:4128"

$ npm config set https-proxy "http://192.168.1.101:4128"

where 192.168.1.101 is proxy ip and 4128 is port. change according to your proxy settings.

@misachi

This comment has been minimized.

misachi commented Jul 26, 2016

Had the same issue and did what @kul1010 suggested above.Now am okay

@kul1010

This comment has been minimized.

kul1010 commented Jul 26, 2016

@misachi check what proxy settings, You are using. Go to Run prompt --> Type inetcpl.cpl--> press Enter-->Choose connections tab-->Lan settings-->See your proxy settings

After this open command prompt or GIT Bash and set proxy according to above command

@davenso

This comment has been minimized.

davenso commented Aug 1, 2016

You need to set this in your ~/.profile file. Source the file and that should fix the proxy issues. Make sure settings there are not conflicting with settings in /.npmrc file. Better to clear .npmrc and use a single proxy settings source (/.profile).

@ForsakenEcho

This comment has been minimized.

ForsakenEcho commented Sep 30, 2016

man still not working for me I set both the proxy and https-proxy and the registry. npm config list listed those correct value which I set. STILL NOT WORKING. ECONNREFUSED by Proxy 24*7 someone save me.

@hariiharant

This comment has been minimized.

hariiharant commented Sep 30, 2016

This is how my config looks like:

http-proxy = "http://blah-blah"
https-proxy = "http://blah-blah"
proxy = "http://blah-blah/"
registry = "http://registry.npmjs.org/"
strict-ssl = false

try all parameters and see if it helps in anyway...

@oras

This comment has been minimized.

oras commented Oct 30, 2016

Its look like an firewall or network security problem, when I used other network the install was successes.

@gifthlong

This comment has been minimized.

gifthlong commented Nov 11, 2016

Hi all this is still failing for me. Please see config:

26664 info git [ 'clone',
26664 info git   '--template=C:\\Users\\ghlongoane\\AppData\\Roaming\\npm-cache\\_git-remotes\\_templates',
26664 info git   '--mirror',
26664 info git   'git://github.com/polymerelements/test-fixture.git',
26664 info git   'C:\\Users\\ghlongoane\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-github-com-polymerelements-test-fixture-git-4485c51b' ]
26665 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-4485c51b: Cloning into bare repository 'C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-4485c51b'...
26665 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-4485c51b: fatal: unable to access 'https://github.com/polymerelements/test-fixture.git/': Failed to connect to github.com port 443: Timed out
26666 silly tryHTTPS attempting to clone git+https://github.com/polymerelements/test-fixture.git
26667 silly tryClone cloning polymerelements/test-fixture via git+https://github.com/polymerelements/test-fixture.git
26668 verbose tryClone git-https-github-com-polymerelements-test-fixture-git-a8830b55 not in flight; caching
26669 verbose correctMkdir C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes correctMkdir not in flight; initializing
26670 info git [ 'config', '--get', 'remote.origin.url' ]
26671 warn addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
26671 warn addRemoteGit
26671 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:206:12)
26671 warn addRemoteGit     at emitTwo (events.js:106:13)
26671 warn addRemoteGit     at ChildProcess.emit (events.js:191:7)
26671 warn addRemoteGit     at maybeClose (internal/child_process.js:877:16)
26671 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
26671 warn addRemoteGit  polymerelements/test-fixture resetting remote C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-polymerelements-test-fixture-git-a8830b55 because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
26671 warn addRemoteGit
26671 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:206:12)
26671 warn addRemoteGit     at emitTwo (events.js:106:13)
26671 warn addRemoteGit     at ChildProcess.emit (events.js:191:7)
26671 warn addRemoteGit     at maybeClose (internal/child_process.js:877:16)
26671 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
26671 warn addRemoteGit   killed: false,
26671 warn addRemoteGit   code: 1,
26671 warn addRemoteGit   signal: null,
26671 warn addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
26672 info resetRemote resetting C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-polymerelements-test-fixture-git-a8830b55 for polymerelements/test-fixture
26673 silly gentlyRm C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-polymerelements-test-fixture-git-a8830b55 is being purged
26674 verbose gentlyRm don't care about contents; nuking C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-polymerelements-test-fixture-git-a8830b55
26675 silly vacuum-fs purging C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-polymerelements-test-fixture-git-a8830b55
26676 silly vacuum-fs quitting because other entries in C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes
26677 info git [ 'clone',
26677 info git   '--template=C:\\Users\\ghlongoane\\AppData\\Roaming\\npm-cache\\_git-remotes\\_templates',
26677 info git   '--mirror',
26677 info git   'https://github.com/polymerelements/test-fixture.git',
26677 info git   'C:\\Users\\ghlongoane\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-https-github-com-polymerelements-test-fixture-git-a8830b55' ]
26678 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-polymerelements-test-fixture-git-a8830b55: Cloning into bare repository 'C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-polymerelements-test-fixture-git-a8830b55'...
26678 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-polymerelements-test-fixture-git-a8830b55: fatal: unable to access 'https://github.com/polymerelements/test-fixture.git/': Failed to connect to github.com port 443: Timed out
26679 silly trySSH attempting to clone git@github.com:polymerelements/test-fixture.git
26680 silly tryClone cloning polymerelements/test-fixture via git@github.com:polymerelements/test-fixture.git
26681 verbose tryClone git-github-com-polymerelements-test-fixture-git-8142662e not in flight; caching
26682 verbose correctMkdir C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes correctMkdir not in flight; initializing
26683 info git [ 'config', '--get', 'remote.origin.url' ]
26684 warn addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
26684 warn addRemoteGit
26684 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:206:12)
26684 warn addRemoteGit     at emitTwo (events.js:106:13)
26684 warn addRemoteGit     at ChildProcess.emit (events.js:191:7)
26684 warn addRemoteGit     at maybeClose (internal/child_process.js:877:16)
26684 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
26684 warn addRemoteGit  polymerelements/test-fixture resetting remote C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
26684 warn addRemoteGit
26684 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:206:12)
26684 warn addRemoteGit     at emitTwo (events.js:106:13)
26684 warn addRemoteGit     at ChildProcess.emit (events.js:191:7)
26684 warn addRemoteGit     at maybeClose (internal/child_process.js:877:16)
26684 warn addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
26684 warn addRemoteGit   killed: false,
26684 warn addRemoteGit   code: 1,
26684 warn addRemoteGit   signal: null,
26684 warn addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
26685 info resetRemote resetting C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e for polymerelements/test-fixture
26686 silly gentlyRm C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e is being purged
26687 verbose gentlyRm don't care about contents; nuking C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e
26688 silly vacuum-fs purging C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e
26689 silly vacuum-fs quitting because other entries in C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes
26690 info git [ 'clone',
26690 info git   '--template=C:\\Users\\ghlongoane\\AppData\\Roaming\\npm-cache\\_git-remotes\\_templates',
26690 info git   '--mirror',
26690 info git   'git@github.com:polymerelements/test-fixture.git',
26690 info git   'C:\\Users\\ghlongoane\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-github-com-polymerelements-test-fixture-git-8142662e' ]
26691 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e: Cloning into bare repository 'C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e'...
26691 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e: Host key verification failed.
26691 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e: fatal: Could not read from remote repository.
26691 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e:
26691 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e: Please make sure you have the correct access rights
26691 error git clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e: and the repository exists.
26692 silly fetchPackageMetaData Error: Command failed: git -c core.longpaths=true clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e
26692 silly fetchPackageMetaData Cloning into bare repository 'C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e'...
26692 silly fetchPackageMetaData Host key verification failed.
26692 silly fetchPackageMetaData fatal: Could not read from remote repository.
26692 silly fetchPackageMetaData
26692 silly fetchPackageMetaData Please make sure you have the correct access rights
26692 silly fetchPackageMetaData and the repository exists.
26692 silly fetchPackageMetaData
26692 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:206:12)
26692 silly fetchPackageMetaData     at emitTwo (events.js:106:13)
26692 silly fetchPackageMetaData     at ChildProcess.emit (events.js:191:7)
26692 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:877:16)
26692 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
26692 silly fetchPackageMetaData  error for test-fixture@github:polymerelements/test-fixture { Error: Command failed: git -c core.longpaths=true clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e
26692 silly fetchPackageMetaData Cloning into bare repository 'C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e'...
26692 silly fetchPackageMetaData Host key verification failed.
26692 silly fetchPackageMetaData fatal: Could not read from remote repository.
26692 silly fetchPackageMetaData
26692 silly fetchPackageMetaData Please make sure you have the correct access rights
26692 silly fetchPackageMetaData and the repository exists.
26692 silly fetchPackageMetaData
26692 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:206:12)
26692 silly fetchPackageMetaData     at emitTwo (events.js:106:13)
26692 silly fetchPackageMetaData     at ChildProcess.emit (events.js:191:7)
26692 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:877:16)
26692 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
26692 silly fetchPackageMetaData   killed: false,
26692 silly fetchPackageMetaData   code: 128,
26692 silly fetchPackageMetaData   signal: null,
26692 silly fetchPackageMetaData   cmd: 'git -c core.longpaths=true clone --template=C:\\Users\\ghlongoane\\AppData\\Roaming\\npm-cache\\_git-remotes\\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\\Users\\ghlongoane\\AppData\\Roaming\\npm-cache\\_git-remotes\\git-github-com-polymerelements-test-fixture-git-8142662e' }
26693 silly rollbackFailedOptional Starting
26694 silly rollbackFailedOptional Finishing
26695 silly runTopLevelLifecycles Finishing
26696 silly install printInstalled
26697 verbose stack Error: Command failed: git -c core.longpaths=true clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e
26697 verbose stack Cloning into bare repository 'C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e'...
26697 verbose stack Host key verification failed.
26697 verbose stack fatal: Could not read from remote repository.
26697 verbose stack
26697 verbose stack Please make sure you have the correct access rights
26697 verbose stack and the repository exists.
26697 verbose stack
26697 verbose stack     at ChildProcess.exithandler (child_process.js:206:12)
26697 verbose stack     at emitTwo (events.js:106:13)
26697 verbose stack     at ChildProcess.emit (events.js:191:7)
26697 verbose stack     at maybeClose (internal/child_process.js:877:16)
26697 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
26698 verbose cwd C:\MyTracker\ThinkTank\HelloPoly
26699 error Windows_NT 10.0.10586
26700 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "polymer-cli"
26701 error node v6.9.1
26702 error npm  v3.10.8
26703 error code 128
26704 error Command failed: git -c core.longpaths=true clone --template=C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:polymerelements/test-fixture.git C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e
26704 error Cloning into bare repository 'C:\Users\ghlongoane\AppData\Roaming\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e'...
26704 error Host key verification failed.
26704 error fatal: Could not read from remote repository.
26704 error
26704 error Please make sure you have the correct access rights
26704 error and the repository exists.
26705 error If you need help, you may report this error at:
26705 error     <https://github.com/npm/npm/issues>
26706 verbose exit [ 1, true ]
@aecorredor

This comment has been minimized.

aecorredor commented Dec 19, 2016

I have tried all the troubleshooting steps that you find on google, stackoverflow, and GitHub when searching for this issue. I still have not been able to fix it, here is the error I'm getting now: (I only have strict-ssl set to false right now, I took out the proxy keys, if I had them I would just get a ECONNREFUSED error)

npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code ECONNRESET

npm ERR! network tunneling socket could not be established, cause=Parse Error
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'

@jachstet-sea

This comment has been minimized.

jachstet-sea commented Jan 13, 2017

@aecorredor: Could you try if my comments at #3084 (comment) are of any help to you?

@ken0709

This comment has been minimized.

ken0709 commented Jan 30, 2017

i use npm command ,but it's see bugs
screen shot 2017-01-30 at 9 14 12 pm

what can i try someting to do ?

thanks

@jachstet-sea

This comment has been minimized.

jachstet-sea commented Jan 30, 2017

@ken0709: This looks not at all related to a proxy problem. So please in the future, create a new issue or ask in a forum. It looks more or less like you don't have NodeJS installed correctly. Try reinstalling NodeJS.

@phpguru

This comment has been minimized.

phpguru commented Mar 3, 2017

Thought I'd chime in. It's possible to get timeouts to http://registry.npmjs.org/fsevents even without being behind a proxy. I'm running in silly log level. The registry URI loads fine in a browser. I'm not sure where :8080 is coming from. At my day job, I have to use a proxy and it does use port 8080; I come home to work and do not use one, so I've gotten quite familiar with .npmrc and the http_proxy and https_proxy settings. I comment them out in .npmrc and restart terminal. Check npm config get http_proxy shows undefined; same for https_proxy - still, it seems somewhere either the network proxy port is getting cached, or I am mis-reading the silly debug output. In the end, it magically works still, it just times out 3 times at the fsevents URL.

npm sill mapToRegistry uri http://registry.npmjs.org/fsevents
npm verb request uri http://registry.npmjs.org/fsevents
npm verb request no auth needed
npm info attempt registry request try #1 at 8:48:21 AM
npm verb request id b5c8567b9413b04c
npm verb etag W/"58aa7c0d-d5c0"
npm verb lastModified Mon, 20 Feb 2017 05:18:05 GMT
npm http request GET http://registry.npmjs.org/fsevents
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 92.242.140.2:8080
@lukx

This comment has been minimized.

lukx commented Mar 9, 2017

@phpguru it might be related to npm not using the config keys http_proxy/https_proxy, but rather proxy/https-proxy (notice hyphen vs. underscore)

@ukyonerv

This comment has been minimized.

ukyonerv commented Apr 22, 2017

@brunowego

Thanks!!

@sreesindhusruthiyadavalli

This comment has been minimized.

sreesindhusruthiyadavalli commented Jun 14, 2017

@brunowego

Thanks !

If some one can let me know the commands to set proxy with out username and password.

@kul1010

This comment has been minimized.

kul1010 commented Jun 14, 2017

What is your OS.
or
follow these step
#9401 (comment)

@sreesindhusruthiyadavalli

This comment has been minimized.

sreesindhusruthiyadavalli commented Jun 16, 2017

@kul1010 It is fixed. I have added npm config set with proxy and npm set strict-ssl false.

Thanks!

@kul1010

This comment has been minimized.

kul1010 commented Jun 16, 2017

very good.

@zhangjin225

This comment has been minimized.

zhangjin225 commented Aug 1, 2017

Hi, I also came across this problem, but I actually did not use proxy, how should I solve this problem?

@kul1010

This comment has been minimized.

kul1010 commented Aug 5, 2017

paste here urs screenshot.

@johnny20

This comment has been minimized.

johnny20 commented Sep 27, 2017

Can anyone explain to me a silly question? On @brunowego comment what have we put at npm config set http-proxy http://username:password@ip:port command as username, password and ip?

@phpguru

This comment has been minimized.

phpguru commented Sep 28, 2017

@johnny20

This comment has been minimized.

johnny20 commented Sep 29, 2017

Thank you for replying and for the explanation. I would like to add that my solution was, to just run nodejs cmd client and not just cmd. After that i just follow the steps. I forget to mention that i have Windows 7 Ult 64 bit.

@lhwu

This comment has been minimized.

lhwu commented Nov 3, 2017

How can i get the useful port ? I don't know which port is useful...My system is Ubuntu 16.04 64bit

@netshiaMR

This comment has been minimized.

netshiaMR commented Nov 29, 2017

hi guy calling for help.
i have try to run this command and it failling and i also check the log file nothing that is help
can anyone help me... i have config my mpmrc file...

C:\Windows\System32>npm install -g @angular/cli
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to https://registry.npmjs.org/@angular%2fcli failed
, reason: connect ECONNREFUSED 10.64.64.21:8080
npm ERR! at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\n
pm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-np
m\src\index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:159:13)
npm ERR! at onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\p
acote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules
\agent-base\index.js:106:9)
npm ERR! at callbackError (C:\Program Files\nodejs\node_modules\npm\node_mod
ules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_m
odules\agent-base\index.js:126:5)
npm ERR! at
npm ERR! at process._tickCallback (internal/process/next_tick.js:188:7)
npm ERR! { FetchError: request to https://registry.npmjs.org/@angular%2fcli fai
led, reason: connect ECONNREFUSED 10.64.64.21:8080
npm ERR! at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\n
pm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-np
m\src\index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:159:13)
npm ERR! at onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\p
acote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules
\agent-base\index.js:106:9)
npm ERR! at callbackError (C:\Program Files\nodejs\node_modules\npm\node_mod
ules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_m
odules\agent-base\index.js:126:5)
npm ERR! at
npm ERR! at process._tickCallback (internal/process/next_tick.js:188:7)
npm ERR! message: 'request to https://registry.npmjs.org/@angular%2fcli failed
, reason: connect ECONNREFUSED 10.64.64.21:8080',
npm ERR! type: 'system',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! code: 'ECONNREFUSED',
npm ERR! stack: 'FetchError: request to https://registry.npmjs.org/@angular%2f
cli failed, reason: connect ECONNREFUSED 10.64.64.21:8080\n at ClientRequest.
req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\
node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:
14)\n at ClientRequest.emit (events.js:159:13)\n at onerror (C:\Program F
iles\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-
happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:106:
9)\n at callbackError (C:\Program Files\nodejs\node_modules\npm\node_mod
ules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\
node_modules\agent-base\index.js:126:5)\n at \n at process._t
ickCallback (internal/process/next_tick.js:188:7)' }
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\NetshiR2\AppData\Roaming\npm-cache_logs\2017-11-29T09_47_
07_536Z-debug.log
C:\Windows\System32>

@robertsmith16

This comment has been minimized.

robertsmith16 commented Dec 1, 2017

Same problems as all above with the proxy. Could this possibly have something to do with an ntlm proxy?

@leovafme

This comment has been minimized.

leovafme commented Dec 28, 2017

remove http_proxy in the environment vars system

@pavanshirguppi

This comment has been minimized.

pavanshirguppi commented Feb 7, 2018

go to the lan settings under settings/options of the browser and then check automatically uncheck all other options.

then type the following commands in series. you should be good to go.

npm config set proxy null
npm config set https-proxy null
npm config rm proxy
npm config rm https-proxy
npm install

@luckyDaveKim

This comment has been minimized.

luckyDaveKim commented Feb 8, 2018

@ken0709 I think you don't have installed correctly. you need to reinstall at here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.