在Windows 7上安装sails-mongo致命错误

我正在尝试安装https://www.npmjs.org/package/sails-mongo ,它的版本是0.9.6而不是0.9.7(最新版本)。 我在Windows 7上有最新的node.js(0.10.25 64位)mongodb(2.4.9 64位)

C:\my_project\backend>npm install sails-mongo

无论如何,我得到了致命的错误:

 npm http GET https://registry.npmjs.org/sails-mongo/0.9.6 npm http 304 https://registry.npmjs.org/sails-mongo/0.9.6 npm http GET https://registry.npmjs.org/underscore/1.4.4 npm http GET https://registry.npmjs.org/underscore.string/2.3.1 npm http GET https://registry.npmjs.org/async/0.2.9 npm http GET https://registry.npmjs.org/mongodb npm http 304 https://registry.npmjs.org/underscore/1.4.4 npm http 304 https://registry.npmjs.org/underscore.string/2.3.1 npm http 304 https://registry.npmjs.org/async/0.2.9 npm http 304 https://registry.npmjs.org/mongodb npm http GET https://registry.npmjs.org/bson/0.2.5 npm http GET https://registry.npmjs.org/kerberos/0.0.3 npm http 304 https://registry.npmjs.org/bson/0.2.5 npm http 304 https://registry.npmjs.org/kerberos/0.0.3 > kerberos@0.0.3 install C:\my_project\backend\node_modules\sails-mongo\node_modules\m ongodb\node_modules\kerberos > (node-gyp rebuild 2> builderror.log) || (exit 0) C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_modules\kerbe ros>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_ modules\node-gyp\bin\node-gyp.js" rebuild kerberos.cc worker.cc security_credentials.cc security_buffer.cc security_buffer_descriptor.cc security_context.cc C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::Object ] C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\no de_modules\kerberos\build\kerberos.vcxproj] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::Object ] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::FunctionTemplate ] C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\no de_modules\kerberos\build\kerberos.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\no de_modules\kerberos\build\kerberos.vcxproj] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::Object ] C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\no de_modules\kerberos\build\kerberos.vcxproj] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::FunctionTemplate ] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::Object ] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::FunctionTemplate ] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::Object ] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::FunctionTemplate ] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_ modules\kerberos\build\kerberos.vcxproj] with [ T=v8::Object ] C:\Users\myname\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::H andle<T>)' [C:\my_project\backend\node_modules\sails-mongo\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:\my_project\back end\node_modules\sails-mongo\node_modules\mongodb\node_modules\kerberos\build\k erberos.vcxproj] > bson@0.2.5 install C:\my_project\backend\node_modules\sails-mongo\node_modules\mongo db\node_modules\bson > (node-gyp rebuild 2> builderror.log) || (exit 0) C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_modules\bson> node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modu les\node-gyp\bin\node-gyp.js" rebuild bson.cc C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\no de_modules\bson\build\bson.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h(26): fa tal error C1083: Cannot open include file: 'ammintrin.h': No such file or direc tory [C:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_module s\bson\build\bson.vcxproj] sails-mongo@0.9.6 node_modules\sails-mongo ├── async@0.2.9 ├── underscore@1.4.4 ├── underscore.string@2.3.1 └── mongodb@1.3.23 (kerberos@0.0.3, bson@0.2.5) 

这是为了让你更容易:

 LINK : fatal error LNK1181: cannot open input file 'kernel32.lib' [C:\my_project\back end\node_modules\sails-mongo\node_modules\mongodb\node_modules\kerberos\build\k erberos.vcxproj] 

任何想法为什么? 以及如何解决这个问题?

更新1:

我跟着这篇文章http://blogs.msdn.com/b/saurabh_singh/archive/2009/01/30/getting-fatal-error-lnk1181-cannot-open-input-file-kernel32-lib.aspx ,似乎解决一个问题,现在我得到了不同的错误:

 npm http GET https://registry.npmjs.org/sails-mongo/0.9.6 npm http 304 https://registry.npmjs.org/sails-mongo/0.9.6 npm http GET https://registry.npmjs.org/async/0.2.9 npm http GET https://registry.npmjs.org/underscore/1.4.4 npm http GET https://registry.npmjs.org/underscore.string/2.3.1 npm http GET https://registry.npmjs.org/mongodb npm http 304 https://registry.npmjs.org/async/0.2.9 npm http 304 https://registry.npmjs.org/underscore/1.4.4 npm http 304 https://registry.npmjs.org/mongodb npm http 304 https://registry.npmjs.org/underscore.string/2.3.1 npm http GET https://registry.npmjs.org/bson/0.2.5 npm http 304 https://registry.npmjs.org/bson/0.2.5 > bson@0.2.5 install c:\my_project\backend\node_modules\sails-mongo\node_modules\mongo db\node_modules\bson > (node-gyp rebuild 2> builderror.log) || (exit 0) c:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_modules\bson> node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modu les\node-gyp\bin\node-gyp.js" rebuild Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. bson.cc c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [c:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\no de_modules\bson\build\bson.vcxproj] c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h(26): fa tal error C1083: Cannot open include file: 'ammintrin.h': No such file or direc tory [c:\my_project\backend\node_modules\sails-mongo\node_modules\mongodb\node_module s\bson\build\bson.vcxproj] sails-mongo@0.9.6 node_modules\sails-mongo ├── underscore@1.4.4 ├── async@0.2.9 ├── underscore.string@2.3.1 └── mongodb@1.3.23 (bson@0.2.5) 

Kerberos需要python。 安装Windows的python并添加到环境variables。

你有没有检查你是否使用正确的软件版本?

如果您使用的是64位操作系统,则必须安装64位版本的Node.js(x64)