npm install failed - Cannot read property 'emit' of null #9984
Comments
Have you fixed it? |
No. Sometimes the build works fine, sometimes I get some error on connection, this "emit" problem and the build fails. |
I've been getting this same error on Here is a stack trace from npm-debug.log:
|
Having the same issue on a Team City instance only, just bumping for visibility. |
For anyone playing along at home: until this is fixed, the workaround for Team City is to into the Version Control Settings and disable the "clean directory" option, and turn off Swabra if you're running it. This aligns with most people saying they get the above error the first time, and then it goes away on subsequent attempts. Obviously this can introduce other wider Team City build issues related to not having a clean directory, but this is a short term fix. |
Is there something smarter we can do here? Even just a retry would likely work for this specific error. This issue has been open for a while without any additional comment, and it's something that gives the impression to people that NPM fails transiently from time to time, which can be a little unnerving. @isaacs @othiym23 , are there any well supported workarounds for this? |
Still actual in |
@arikon you need to update your npm: It won't help you though, because it happens for me intermittently (more often than not with bigger projects with many dependencies) on the latest: It happens to me when running on windows. I haven't seen it yet when I run it on ubuntu. |
@chadly We can't update to |
@chadly I don't think 3.X fixes this issue, I'm seeing it regularly on windows machines with 3.x. |
I am definitely seeing this with npm 3.9.2 on node 6.2.0 I believe this is being caused by request/request#1903 |
I agree with @jmyersmsft, and have updated request/request#1903 with a trivial repro. The bug occurs whenever:
I'll take a look into fixing this at some point over the next week, but if anyone else is already familiar with the request library and wants to, please chime in. |
We see this intermittently on clean installs of a fairly complex project. It seems to be more prevalent on Windows machines, and especially so on single board computer environments (like BeagleBone and Raspberry Pi). Though I have definitely also seen it on my Mac dev machine. It typically runs clean on the second attempt of installing into the same location. It does seem like the underlying problem is in request, and from looking at the several related issues over there, it's not clear to me that the problem is fixed (or well understood). request/request#2028 seems promising, but there seems to be some debate as to whether it actually works, and it's been sitting there for 6 months without getting merged. I think some attempt by npm to catch the error, clean up, and retry would be great if it can be done (as opposed to waiting for request to definitely fix it and and release the fix, as that does not seem imminent). |
@BobDickinson |
@zarenner - did not mean to offend. Maybe I wasn't following all the threads of issues and PRs. I saw your comment on request/request#1903 and I mistakenly though you were indicating that this problem was addressed by request/request#2028 (I see now that you were talking about a potentially related issue). The fact that there seemed to be some debate on request/request#2028 as to whether that fix actually did what was intended is what led to my comment. request/request#2240 looks promising. Let's hope that gets some traction. |
No offense was taken, on the contrary I'm glad there's additional interest here to push a fix (either to request or npm) through :-) |
request has taken the fix and released 2.73. npm simply needs to take request 2.73 now. |
Hello, I'm receiving this error while performing npm install in our continuous integration environment.
The build works fine on my machine (node 0.10.36 npm 2.4.1).
This log was seen while downloading dependencies:
And this were the final lines of the log.
The text was updated successfully, but these errors were encountered: