3

UPDATED:

When I try to install any package with 'npm install', or any variant:

npm install gulp -g -verbose

npm install gulp -verbose

npm install gulp

npm install

npm install connect

I get the following output but it just hangs on the last line, never finishing the install:

npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'install',
npm verb cli   'gulp',
npm verb cli   '-g',
npm verb cli   '-verbose' ]
npm info using npm@2.5.1
npm info using node@v0.12.0
npm verb node symlink C:\Program Files\nodejs\\node.exe
npm verb cache add spec gulp
npm verb addNamed gulp@*
npm verb addNameRange registry:https://registry.npmjs.org/gulp not in flight; fetching
npm verb request uri https://registry.npmjs.org/gulp
npm verb request no auth needed
npm info attempt registry request try #1 at 4:09:05 PM
npm verb request id 77dfc5813704dba8
npm verb etag "EOZJDNUCAN683DXC55T2W1JVT"
npm http request GET https://registry.npmjs.org/gulp
npm http 304 https://registry.npmjs.org/gulp
npm verb etag https://registry.npmjs.org/gulp from cache
npm verb get saving gulp to C:\Users\iwiegand.TMI\AppData\Roaming\npm-cache\registry.npmjs.org\gulp\
.cache.json
npm verb addNamed gulp@3.8.11
npm verb addRemoteTarball https://registry.npmjs.org/gulp/-/gulp-3.8.11.tgz not in flight; adding
npm verb addRemoteTarball [ 'https://registry.npmjs.org/gulp/-/gulp-3.8.11.tgz',
npm verb addRemoteTarball   'd557e0a7283eb4136491969b0497767972f1d28a' ]
^CTerminate batch job (Y/N)?

It's definitely not https, since changing it to http yields the same result. It does this from any folder on my machine, no matter what package, or even just 'npm install'. I've restarted, resintalled node.js, etc. I'm on a Windows 8.1 machine and wishing I had a Mac.

The crazy thing is it HAS worked. I got Composer, Laravel and a bunch of other stuff installed just fine, then one day, it just started doing this. I have no idea what could be interfering. Checking the TaskManager, npm IS running with like 18% CPU usage the whole time it's "trying" to install.

Apparently I'm the only one on Earth with this problem. I've searched and searched on Google and nothing. I'm resorting to Facebook and Google groups. So far no suggestions from SO users have helped, although I very much appreciate the attempts.

sinrise
  • 391
  • 3
  • 21
  • **UPDATE:** I verified this happens while trying to install any package. – sinrise Mar 03 '15 at 00:23
  • Perhaps try with a different internet connection? Also, you don't have to press "y" in the "Terminate batch job (Y/N)?" prompt, just ctrl+c again. – Fabrício Matté Mar 03 '15 at 00:32
  • 1
    And the latest stable npm version is 2.6.1, try updating it: `npm i -g npm` – Fabrício Matté Mar 03 '15 at 00:33
  • Though take care when updating npm, a broken install may render npm unusable. Better make a backup first. – Fabrício Matté Mar 03 '15 at 00:34
  • 1
    Thanks! As it's unusable now anyway, I went ahead and tried to update but it hangs just like when trying to install any package. The last 2 lines are always a URL and what looks like hex: 'npm verb addRemoteTarball [ 'https://registry.npmjs.org/npm/-/npm-2.6.1.tgz', npm verb addRemoteTarball '22aefa7867d021f63d60fadc1eb48f0adb744242' ]' – sinrise Mar 03 '15 at 00:36
  • Could it be my connection? I'm not seeing anything else wrong with my internet. I suppose I'll have to try at another location. Maybe IT made some network changes that restrict this kind of thing? – sinrise Mar 03 '15 at 00:41
  • Tried on a completely different connection. Same result. – sinrise Mar 03 '15 at 01:31
  • What if you run `npm install gulp@3.8.11`? – Fabrício Matté Mar 03 '15 at 01:36
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/72101/discussion-between-sinrise-and-fabricio-matte). – sinrise Mar 03 '15 at 01:51
  • If npm fails halfway through it will still register a package as successfully installed. Try removing the node_modules from they are stored globally on your machine and reinstall. – Anders Bornholm Mar 03 '15 at 12:16

1 Answers1

4

I recently came across this problem and managed to fix it, on my own machine at least, by correcting my TEMP environment variable that had been mucked with by some other installer or npm package. I found an issue on github that was describing the exact same problem and I posted my discovery and resolution there.

Basically, someone had appended ;C:\Python27 to the end of my TEMP which was screwing up the unpacking of the npm module. So, maybe it's a long shot, but check it out and see if it works for you!

thetoast
  • 763
  • 4
  • 9