Search code examples
node.jsangularjsvcbuildkarma-runner

Karma install failing on rebuild npm node.js


So i'm tryin to get karma working on my Windows 7 machine and I'm continuing to have trouble.

I'm using node.js 0.10.7 and using the command npm install -g karma. The first issue was missing vcbuild, so I installed http://www.microsoft.com/en-us/download/details.aspx?id=11310 and added it to my path. Now I'm getting the below error during rebuild:

C:\Users\Steve\AppData\Roaming\npm\node_modules\karma\node_modules\socket.io\nod e_modules\socket.io-client\node_modules\ws>node "C:\Program Files\nodejs\node_mo dules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild

..\src\bufferutil.cc(55): warning C4267: 'initializing' : conversion from 'size _t' to 'unsigned int', possible loss of data ..\src\bufferutil.cc(66): warning C4267: 'initializing' : conversion from 'size _t' to 'unsigned int', possible loss of data C:\Users\Steve.node-gyp\0.10.6\deps\v8\include\v8.h(184): warning C4506: no de finition for inline function 'v8::Persistent v8::Persistent::New(v8::Hand le)'

LINK : fatal error LNK1181: cannot open input file 'C:\Users\Steve.node-gyp\0. 10.6\node.lib'

Project : warning PRJ0018: The following environment variables were not found: C:\Users\Steve.node-gyp\0.10.6\deps\v8\include\v8.h(184): warning C4506: no de finition for inline function 'v8::Persistent v8::Persistent::New(v8::Hand le)'

LINK : fatal error LNK1181: cannot open input file 'C:\Users\Steve.node-gyp\0. 10.6\node.lib'

Project : warning PRJ0018: The following environment variables were not found: C:\Users\Steve\AppData\Roaming\npm\karma -> C:\Users\Steve\AppData\Roaming\npm\n ode_modules\karma\bin\karma

[email protected] C:\Users\Steve\AppData\Roaming\npm\node_modules\karma ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected] .2) ├── [email protected] ├── [email protected] ([email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], n [email protected], [email protected], [email protected], [email protected], [email protected], handleba [email protected]) └── [email protected] ([email protected], [email protected], [email protected], socket.io-c [email protected])

The LINK errors are in read and that directory is missing. The other bold font are warnings. I haven't had problems with node.js, but trying to run karma fails. Any ideas? This is based on the AngularJS tutorial...


Solution

  • If the installer wants the file "C:\Users\Steve\node-gyp\0.10.6\node.lib", you just have to give it that file.

    1. Open the "C:\Users\Steve\node-gyp\0.10.6" directory.

    2. Within that directory, there should be "ia32" and "x64" subdirectories - open the correct one for your architecture.

    3. There should be a "node.lib" file within the subdirectory - simply copy that file to the parent directory (C:\Users\Steve\node-gyp\0.10.6).

    4. Re-run "node install -g karma"

    Once I did that, the karma build still reported a few warnings but no errors.

    To continue with the tutorial, you'll want to add the npm module directory (typically C:\Users\\AppData\Roaming\npm) to your PATH.