npm install getting stuck
Just thought I'd post this here in case anyone else is experiencing this. npm install seems to be getting stuck for me sometimes:
> [email protected] postinstall C:\Users\Tyler\JSworkspace\finaltest\node_modules\g
runt-contrib-imagemin\node_modules\gifsicle
> node lib/check.js
gifsicle.exe: downloading [===================] 100% 0.0s
√ pre-build test passed successfully
> [email protected] postinstall C:\Users\Tyler\JSworkspace\finaltest\node_module
s\grunt-contrib-imagemin\node_modules\optipng-bin
> node lib/check.js
optipng.exe: downloading [===================] 100% 0.0s
√ pre-build test passed successfully
Hangs at the last line. If i end the process and try running grunt serve/build/test, they all work, but it's annoying that its not exiting cleanly. I don't know which dependency is causing this, but it might be a windows only problem.
Nope, it`s not windows only, I think I've experienced that at least once on ubuntu, but I was sure it was just my vm going weird...
Another place it sometimes hangs is on this:
C:\Users\Tyler\.node-gyp\0.10.24\deps\v8\include\v8.h(179): warning C4506: no d
efinition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Han
dle<T>)' [C:\Users\Tyler\JSworkspace\imagemin2\node_modules\karma\node_modules\
socket.io\node_modules\socket.io-client\node_modules\ws\build\validation.vcxpro
j]
with
[
T=v8::Object
]
Creating library C:\Users\Tyler\JSworkspace\imagemin2\node_modules\karma\n
ode_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\Rel
ease\validation.lib and object C:\Users\Tyler\JSworkspace\imagemin2\node_modu
les\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\w
s\build\Release\validation.exp
Generating code
Finished generating code
validation.vcxproj -> C:\Users\Tyler\JSworkspace\imagemin2\node_modules\karma
\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\R
elease\\validation.node
It's hard to test against because it doesn't happen all the time.
For that first error, can you try scrolling all the way up in the logs looking for hung bower instances? Before we switched to hard-coded versions of Angular, Bower would prompt in the middle of the install asking which version of Angular we wanted to use. Since bower and npm ran concurrently, the bower prompt was getting swallowed up by the npm install logs. If you were to press enter, it should have re-prompted.
@eddiemonge Good point. I'll look out for that next time I run into this problem.
I was running into this problem too. Narrowed it down to mongoose and jpegtran-bin. I set those two dependencies to "latest" in package.json and npm install worked for me after that.
@mike360 Good to know. What OS are you running?
@DaftMonk OS X 10.9.1. node v0.10.25. npm 1.3.24.
@mike360 Thanks!
@DaftMonk FWIW A lot of Yeoman generators (or, more specifically npm) have been screwing up for me lately so take this with a grain of salt.
I noticed this today as well. Hadn't used the generator for a few months and came back to it yesterday - npm just hangs every time. I sometimes get Error: shasum check failed for various modules (different modules each time), sometimes I get Error: connect ETIMEDOUT for phantomjs, and if all seems to go well it just hangs when it gets to √ pre-build test passed successfully. Using latest stable versions of node and npm, 0.10.26 and 1.4.6 respectively. Very frustrating :(
@darryl-snow I think its the imagemin package thats causing the problems, it's a very finicky package. It gives me so much trouble I'd consider making it optional, however I'm worried about bloating the options too much, maybe there's some way to improve the interface for adding more options.
I've had various issues with imagemin too. Currently I'm getting this each time I try and run grunt serve:
Loading "imagemin.js" tasks...ERROR Error: Cannot find module 'cache-file'
"grunt-contrib-imagemin": "latest" in my package.json fixed the hanging and other misc errors
i am getting this error in installation

@Nirajkashyap can you show us outputs of:
$ yo --version
@Nirajkashyap You need to run npm update -g yo

now updating yo version by :

got this error

and yo version is also not get updated node version : node -v v0.10.25
npm version : npm -v 1.3.24
i have also cleared the cache for npm by: "npm cache clean"
Maybe try reinstalling with npm uninstall -g yo and then npm install -g yo
@Nirajkashyap, what is the npm version? Because you're seeing yo 1.1.2 as the latest, but it should be 1.2.x.
I'd try to update npm with
npm update -g npm
and then reinstall yo with
npm install -g yo
Let us know. ;)
Hey! @dapids and @DaftMonk thanks. issue is solved. npm version was old.
:) thanks