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

npm install hangs, after a long time eventually finishes (probably proxy issues) #15614

Closed
dialex opened this issue Jan 30, 2017 · 8 comments

Comments

@dialex
Copy link

commented Jan 30, 2017

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

How can the CLI team reproduce the problem?

  • My terminal bash is ConEmu. Same happens with Git Bash.
  • I'm working behind a firewall, and I managed to configure it, and it was working for about a month until today's afternoon.
  • When I do npm install it takes a long time (whole build used to be 4 mins, now takes 11 mins).
  • After all that time the build finishes and it works. The delay seems to be caused by several attempts to reach npm's registry.
  • I already have tried deleting the node_modules folder. And setting registry to use http. And resetting the %TEMP% var and folder.
  • It's not the source code, as my colleagues don't have any issue, so it must be some env config.

I can't access Gist (Access Denied by my company's firewall/policy) so I'll paste it below. This is the verbose output of npm install of my project. Notice the amount of retries and errors trying to reach registry.

$ npm install --verbose
npm info it worked if it ends with ok
npm verb cli [ 'D:\\nodejs\\node.exe',
npm verb cli   'D:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'install',
npm verb cli   '--verbose' ]
npm info using npm@3.10.10
npm info using node@v6.9.4
npm verb request uri http://registry.npmjs.org/websocket
npm verb request no auth needed
npm info attempt registry request try #1 at 5:55:14 PM
npm verb request id 004401d62639b768
npm verb etag W/"586471de-10165"
npm verb lastModified Thu, 29 Dec 2016 02:15:58 GMT
npm http request GET http://registry.npmjs.org/websocket
npm info retry will retry, error on last attempt: Error: unexpected end of file
npm info attempt registry request try #2 at 5:55:24 PM
npm verb etag W/"586471de-10165"
npm verb lastModified Thu, 29 Dec 2016 02:15:58 GMT
npm http request GET http://registry.npmjs.org/websocket
npm info retry will retry, error on last attempt: Error: unexpected end of file
npm info attempt registry request try #3 at 5:56:24 PM
npm verb etag W/"586471de-10165"
npm verb lastModified Thu, 29 Dec 2016 02:15:58 GMT
npm http request GET http://registry.npmjs.org/websocket
npm verb etag http://registry.npmjs.org/websocket from cache
npm verb get saving websocket to C:\Users\***USER***\AppData\Roaming\npm-cache\registry.npmjs.org\websocket\.cache.json
npm verb correctMkdir C:\Users\***USER***\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
npm verb cache add spec websocket@latest
npm verb addNamed "latest" is being treated as a dist-tag for websocket
npm info addNameTag [ 'websocket', 'latest' ]
npm verb addNameTag registry:http://registry.npmjs.org/websocket not in flight; fetching
npm verb get http://registry.npmjs.org/websocket not expired, no request
npm verb addNamed "1.0.24" is a plain semver version for websocket
npm verb afterAdd C:\Users\***USER***\AppData\Roaming\npm-cache\websocket\1.0.24\package\package.json not in flight; writing
npm verb correctMkdir C:\Users\***USER***\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
npm verb afterAdd C:\Users\***USER***\AppData\Roaming\npm-cache\websocket\1.0.24\package\package.json written
npm verb request uri http://registry.npmjs.org/fsevents
npm verb request no auth needed
npm info attempt registry request try #1 at 5:56:24 PM
npm verb etag W/"5886285d-c238"
npm verb lastModified Mon, 23 Jan 2017 15:59:25 GMT
npm http request GET http://registry.npmjs.org/fsevents
npm info retry will retry, error on last attempt: Error: unexpected end of file
npm info attempt registry request try #2 at 5:56:34 PM
npm verb etag W/"5886285d-c238"
npm verb lastModified Mon, 23 Jan 2017 15:59:25 GMT
npm http request GET http://registry.npmjs.org/fsevents
npm info retry will retry, error on last attempt: Error: unexpected end of file
...

supporting information:

This is my current configuration, after many trial and error:

$ npm config list
; cli configs
user-agent = "npm/3.10.10 node/v6.9.4 win32 x64"

; userconfig C:\Users\***user***\.npmrc
http-proxy = "http://***user***:***pass***@***domain***:***port***"
https-proxy = "http://***user***:***pass***@***domain***:***port***/"
progress = false
proxy = "http://***user***:***pass***@***domain***:***port***/"
registry = "http://registry.npmjs.org/"
strict-ssl = false

; globalconfig C:\Users\***user***\AppData\Roaming\npm\etc\npmrc
registry = "http://registry.npmjs.org/"

; builtin config undefined
prefix = "C:\\Users\\***user***\\AppData\\Roaming\\npm"

; node bin location = D:\nodejs\node.exe
; cwd = C:\Users\***user***
; HOME = C:\Users\***user***
; "npm config ls -l" to show all defaults.
  • npm -v prints: 3.10.10
  • node -v prints: v6.9.4
  • npm config get registry prints: http://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Windows x64
  • Network issues: I'm behind a proxy
    • Geographic location where npm was run:
    • I use a proxy to connect to the npm registry.
    • I use a proxy to connect to the web.
    • I use a proxy when downloading Git repos.
    • I access the npm registry via a VPN
    • I don't use a proxy, but have limited or unreliable internet access.

Help please 😭

@legodude17

This comment has been minimized.

Copy link
Contributor

commented Jan 30, 2017

Is there a way you can test it without the proxy?

@dialex

This comment has been minimized.

Copy link
Author

commented Jan 31, 2017

After removing those 3 proxy configs I continue to receive errors:

npm http request GET http://registry.npmjs.org/websocket
npm info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:80
npm info attempt registry request try #2 at 9:22:01 AM
npm verb etag W/"586471de-10165"
npm verb lastModified Thu, 29 Dec 2016 02:15:58 GMT
npm http request GET http://registry.npmjs.org/websocket
npm info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:80
@dialex

This comment has been minimized.

Copy link
Author

commented Jan 31, 2017

So given that initial npm config list, I did a npm cache clean (link). That seemed to work the first time, but now it doesn't.

I'm working on a VM, I getting crazy with this, I think I'll request a new one. Proxies are horrible.

@dialex dialex closed this Feb 2, 2017

@dialex

This comment has been minimized.

Copy link
Author

commented Feb 2, 2017

My bad, my company had placed me by accident on a more restrictive user group on Active Directory... Now it's solved!

@jlee-locktonmylo

This comment has been minimized.

Copy link

commented Apr 13, 2017

@dialex when you said this:

My bad, my company had placed me by accident on a more restrictive user group on Active Directory... Now it's solved!

What did you mean? What was the policy that was causing this issue? We have a proxy and I am having similar issues. Curious if it was your proxy or something else.

@legodude17

This comment has been minimized.

Copy link
Contributor

commented Apr 13, 2017

@jlee-locktonmylo Try disabling the proxy.

@jlee-locktonmylo

This comment has been minimized.

Copy link

commented Apr 13, 2017

@legodude17 I was afraid that would be the response. It is proxy related, using a hotspot on my phone it works fine. It is a corporate policy to use a proxy so they will have to figure out a way around it for npm things. :(

@legodude17

This comment has been minimized.

Copy link
Contributor

commented Apr 13, 2017

@jlee-locktonmylo Yeah. Sorry for the inconvenience.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.