2013-07-14 106 views
2

i'ms要安装在内角项目的NodeJS和猫鼬我有这个错误错误MSB007 node.js的猫鼬

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform 
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform 
.Targets(23,7): error MSB8007: The Platform for project 'kerberos.vcxproj' is i 
.Targets(23,7): error MSB8007: The Platform for project 'bson.vcxproj' is inval 
nvalid. Platform='x64'. You may be seeing this message because you are trying 
id. Platform='x64'. You may be seeing this message because you are trying to b 
to build a project without a solution file, and have specified a non-default Pl 
uild a project without a solution file, and have specified a non-default Platfo 
atform that doesn't exist for this project. [c:\testNodeMongoose\node_modules\m 
rm that doesn't exist for this project. [c:\testNodeMongoose\node_modules\mongo 
ongoose\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj] 
ose\node_modules\mongodb\node_modules\bson\build\bson.vcxproj] 

但我有安装Python和Visual Studio 2010 Express和绞股蓝皂苷。当我尝试安装socket.io我有同样的问题...

回答

4

VS Express有没有64位构建支持,所以你有几个选择这里:

  • 安装完整的试用版Visual Studio套件
  • 卸载64位的节点,并使用x86版本
  • 安装Windows SDK

我个人推荐第二(win32的节点),因为SDK安装是t中的痛苦他回来了(主要是失败,没有错误信息,这可能是“坏”vcredist版本的标志),而完整的Visual Studio并不便宜(而试用版并非永久性解决方案)。

1

32位节点报告bsonkerberos的警告。
我不明白为什么node-gyp甚至被解雇。我认为本地软件包是预先构建的,为我的操作系统提供了二进制文件?
嗯,我想我想错了。

... 
npm http 304 https://registry.npmjs.org/bson/0.2.2 
npm http 304 https://registry.npmjs.org/kerberos/0.0.3 

> [email protected] install D:\mbo\repos\mean-mbo\node_modules\mongodb\node_modules\kerberos 
> (node-gyp rebuild 2> builderror.log) || (exit 0) 


D:\mbo\repos\mean-mbo\node_modules\mongodb\node_modules\kerberos>node "C:\Program Files (x86)\nodejs 
\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild 

> [email protected] install D:\mbo\repos\mean-mbo\node_modules\mongodb\node_modules\bson 
> (node-gyp rebuild 2> builderror.log) || (exit 0) 


D:\mbo\repos\mean-mbo\node_modules\mongodb\node_modules\bson>node "C:\Program Files (x86)\nodejs\nod 
e_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 
    bson.cc 
C:\Users\mbo\.node-gyp\0.10.18\deps\v8\include\v8.h(184): warning C4506: no definition for inline 
function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [D:\mbo\repos\mean-mbo\node_mod 
ules\mongodb\node_modules\kerberos\build\kerberos.vcxproj] 
      with 
      [ 
       T=v8::Object 
      ] 
C:\Users\mbo\.node-gyp\0.10.18\deps\v8\include\v8.h(184): warning C4506: no definition for inline 
function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [D:\mbo\repos\mean-mbo\node_mod 
ules\mongodb\node_modules\kerberos\build\kerberos.vcxproj] 
      with 
      [ 
       T=v8::FunctionTemplate 
      ] 
C:\Users\mbo\.node-gyp\0.10.18\deps\v8\include\v8.h(179): warning C4506: no definition for inline 
function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [D:\mbo\repos\mean-mbo\node_mod 
ules\mongodb\node_modules\kerberos\build\kerberos.vcxproj] 
      with 
      [ 
       T=v8::Object 
      ] 
    security_buffer_descriptor.cc 
    security_context.cc 
+0

你有没有解决这个问题?我现在有完全相同的问题。 :) – Marek

+0

我不想安装* VisualStudio *,所以我用Ubuntu。类似的事情发生在Ubuntu中,但* node-gyp *无需任何额外的安装即可成功构建它。 –

+0

这帮助我在Windows上获得了不同的错误:https://groups.google.com/d/msg/node-mongodb-native/lz3-e1_WZP4/JJETYDDQrMUJ – Shoreline

1

确保您拥有所有必需的软件运行node-gyp

,可以配置环境变量使用gyp的Visual Studio版本,这样就可以避免每次进行npm安装时必须设置--msvs_version=2012属性。

例子:

  • 设置GYP_MSVS_VERSION=2012为Visual Studio 2012
  • 设置GYP_MSVS_VERSION=2013e(在 'E' 代表 'Express版')

有关完整列表,请参阅 - https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294

对于NodeJS的Windows用户来说,这仍然很痛苦,因为它假定你有一个Visual Studio i的副本安装和许多最终用户将永远不会有这个。因此,我正在向Joyent游说,鼓励他们将网络套接字包含为CORE节点的一部分,并且还可以将GNU gcc编译器作为NodeJS安装的一部分发布,以便我们可以永久解决此问题。

随意在添加您的投票: