Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
错误MSB007 node.js mongoose_Node.js_Socket.io_Mongoose - Fatal编程技术网

错误MSB007 node.js mongoose

错误MSB007 node.js mongoose,node.js,socket.io,mongoose,Node.js,Socket.io,Mongoose,我正试图在mys nodeJS项目上安装mongoose,但出现了这个错误 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 proj

我正试图在mys nodeJS项目上安装mongoose,但出现了这个错误

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、VisualStudio2010Express和Gyp。当我尝试安装socket.io时,我也遇到了同样的问题…

VS Express没有x64版本支持,因此您可以在这里选择以下两种选项:

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

我个人推荐第二个(win32 node),因为SDK安装是一件麻烦事(大多数情况下,安装失败时没有错误消息,这“可能”是“坏”vcredist版本的标志),而且完整的VisualStudio并没有那么便宜(而试用并不是一个永久性的解决方案).

32位节点为
bson
kerberos
报告警告
我不明白为什么被解雇了。我认为本机软件包是预构建的,带有用于我的操作系统的二进制文件?
嗯,我想我想错了

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

> kerberos@0.0.3 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

> bson@0.2.2 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
。。。
npm http 304https://registry.npmjs.org/bson/0.2.2
npm http 304https://registry.npmjs.org/kerberos/0.0.3
> kerberos@0.0.3安装D:\mbo\repos\mean mbo\node\u modules\mongodb\node\u modules\kerberos
>(节点gyp rebuild 2>builderror.log)| |(退出0)
D:\mbo\repos\mean mbo\node\u modules\mongodb\node\u modules\kerberos>node“C:\Program Files(x86)\nodejs
\node_modules\npm\bin\node gyp bin\\..\..\node_modules\node gyp\bin\node gyp.js“重建”
> bson@0.2.2安装D:\mbo\repos\mean mbo\node\u modules\mongodb\node\u modules\bson
>(节点gyp rebuild 2>builderror.log)| |(退出0)
D:\mbo\repos\mean mbo\node\u modules\mongodb\node\u modules\bson>node“C:\Program Files(x86)\nodejs\nod
e_modules\npm\bin\node gyp bin\\..\..\node_modules\node gyp\bin\node gyp.js“重建”
kerberos.cc
worker.cc
security_credentials.cc
安全缓冲区.cc
bson.cc
C:\Users\mbo\.node gyp\0.10.18\deps\v8\include\v8.h(184):警告C4506:没有内联的定义
函数“v8::Persistent v8::Persistent::New(v8::Handle)”[D:\mbo\repos\mean mbo\node\u mod
ules\mongodb\node\u modules\kerberos\build\kerberos.vcxproj]
具有
[
T=v8::对象
]
C:\Users\mbo\.node gyp\0.10.18\deps\v8\include\v8.h(184):警告C4506:没有内联的定义
函数“v8::Persistent v8::Persistent::New(v8::Handle)”[D:\mbo\repos\mean mbo\node\u mod
ules\mongodb\node\u modules\kerberos\build\kerberos.vcxproj]
具有
[
T=v8::FunctionTemplate
]
C:\Users\mbo\.node gyp\0.10.18\deps\v8\include\v8.h(179):警告C4506:没有内联的定义
函数“v8::Persistent v8::Persistent::New(v8::Handle)”[D:\mbo\repos\mean mbo\node\u mod
ules\mongodb\node\u modules\kerberos\build\kerberos.vcxproj]
具有
[
T=v8::对象
]
安全缓冲区描述符.cc
security_context.cc

确保您拥有运行节点gyp所需的所有软件:

您可以通过环境变量配置
gyp
使用的Visual Studio版本,这样就可以避免每次安装npm时都必须设置
--msvs\u version=2012
属性

示例:

  • 为Visual Studio 2012设置
    GYP\u MSVS\u VERSION=2012
  • set
    GYP\u MSVS\u VERSION=2013e
    (“e”代表“express edition”)
有关完整列表,请参阅 -

这对NodeJS的Windows用户来说仍然是痛苦的,因为它假设您安装了visualstudio的副本,而许多最终用户永远不会安装它。因此,我正在游说Joyent,以鼓励他们将web套接字作为核心节点的一部分,并可能将GNU gcc编译器作为NodeJS安装的一部分提供,这样我们就可以永久解决这个问题

请随时在以下网址添加您的投票:


您是否解决了此问题?我现在也有同样的问题。:)我不想安装VisualStudio,所以我使用了Ubuntu。类似的事情也发生在Ubuntu中,但node gyp在没有任何额外安装的情况下成功构建了它。这帮助我在windows上得到了一个不同的错误: