Trouble installing node-mongodb-native on windows 7 (64)

1,591 views
Skip to first unread message

Bg Sosh

unread,
May 1, 2013, 9:19:46 AM5/1/13
to node-mong...@googlegroups.com
I've been using both mongoskin and mongoose without problems for a while, but wanted to update these in NPM - however they both were throwing build errors when npm installing on windows.

Turns out that both were failing when installing their node-mongodb-native dependency.  

Initially I was getting errors about missing VCBuild.exe.  I've since installed the Window7SDK which supposedly contains the compiler and other required files.  However, now I'm this error:  

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(297,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.
 TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [C:\Users\xxxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\bson\
build\bson.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(146,5): error : Required file "" is missing. [C:\Users\xxxx\AppData\
Roaming\npm\node_modules\mongodb\node_modules\bson\build\bson.vcxproj]

I'm getting these errors when node-mongodb-native is installing bson and kerberos components.

1) Does anyone know how I can fix this?

2) I only use windows for development, so don't care much about performance.  Is there a way to install node-mongodb-native without native compilation?

Thanks

Bg Sosh

unread,
May 1, 2013, 12:48:54 PM5/1/13
to node-mong...@googlegroups.com
I've since installed MS Visual C++  Express 2010 and tried again.  Now different errors:

C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\bson>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\no
de-gyp\bin\node-gyp.js" rebuild
  kerberos.cc
  worker.cc
  security_credentials.cc
  security_buffer.cc
  bson.cc
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
  security_buffer_descriptor.cc
  security_context.cc
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. S
pecify /EHsc [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. S
pecify /EHsc [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. S
pecify /EHsc [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\bson\build\bson.vcxproj]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
..\ext\bson.cc(547): warning C4244: 'argument' : conversion from 'int64_t' to 'double', possible loss of data [C:\Users\xxx\AppData\Roaming\npm\node_modules\
mongodb\node_modules\bson\build\bson.vcxproj]
..\ext\bson.cc(308): warning C4267: 'initializing' : conversion from 'size_t' to 'uint32_t', possible loss of data [C:\Users\xxx\AppData\Roaming\npm\node_mod
ules\mongodb\node_modules\bson\build\bson.vcxproj]
          ..\ext\bson.cc(137) : while compiling class template member function 'void BSONSerializer<T>::SerializeValue(void *,const v8::Handle<v8::Value> &)'
          with
          [
              T=CountStream
          ]
          ..\ext\bson.cc(83) : while compiling class template member function 'void BSONSerializer<T>::SerializeDocument(const v8::Handle<v8::Value> &)'
          with
          [
              T=CountStream
          ]
          ..\ext\bson.cc(844) : see reference to class template instantiation 'BSONSerializer<T>' being compiled
          with
          [
              T=CountStream
          ]
..\ext\bson.cc(308): warning C4267: 'initializing' : conversion from 'size_t' to 'uint32_t', possible loss of data [C:\Users\xxx\AppData\Roaming\npm\node_mod
ules\mongodb\node_modules\bson\build\bson.vcxproj]
          ..\ext\bson.cc(137) : while compiling class template member function 'void BSONSerializer<T>::SerializeValue(void *,const v8::Handle<v8::Value> &)'
          with
          [
              T=DataStream
          ]
          ..\ext\bson.cc(83) : while compiling class template member function 'void BSONSerializer<T>::SerializeDocument(const v8::Handle<v8::Value> &)'
          with
          [
              T=DataStream
          ]
          ..\ext\bson.cc(853) : see reference to class template instantiation 'BSONSerializer<T>' being compiled
          with
          [
              T=DataStream
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\bson\build\bson.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\bson\build\bson.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. S
pecify /EHsc [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\bson\build\bson.vcxproj
]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. S
pecify /EHsc [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::Object
          ]
C:\Users\xxx\.node-gyp\0.10.5\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handl
e<T>)' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ]
  kerberos_sspi.c
  base64.c
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib' [C:\Users\xxx\AppData\Roaming\npm\node_modules\mongodb\node_modules\kerberos\build\kerberos
.vcxproj]


Absolutely no idea what's going on now :/

christkv

unread,
May 1, 2013, 12:57:08 PM5/1/13
to node-mong...@googlegroups.com
the only way I've ever been able to build it is with

visual studio express 2010 + windows 7.1 sdk. DO not use 2012 

Don't build the package yourself install without the dev tools as bson comes with the binaries pre-compiled and will show errors but installs. The problem is that you can cannot conditionally run node-gyp on windows (or at least I have not figured out how yet) so it will fail but still install.

If you do go through the pain of install the tools you need to build form the visual studio command line. If you have a mix of tool sets you are screwed. You need windows 7 64 bit sdk on a 64 system etc.

Bg Sosh

unread,
May 1, 2013, 1:15:34 PM5/1/13
to node-mong...@googlegroups.com
Thanks.  So do you mean that I should just do npm install and ignore the (first set of) errors?  
Reply all
Reply to author
Forward
0 new messages