错误MSB007 node.js mongoose
我正试图在mys nodeJS项目上安装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
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
(“e”代表“express edition”)GYP\u MSVS\u VERSION=2013e