i'ms trying to install mongoose on mys nodeJS project and i have this error
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]
But i had install Python and visual studio 2010 express and Gyp. When i trying to install socket.io i have the same problem...
VS Express has no x64 build support, so you have a couple of options here:
I personally recommend the second (win32 node), since the SDK install is a pain in the back (mostly it fails with no error messages, which "may be" the sign of a "bad" vcredist version), and the full Visual Studio is not that cheap (while the trial is not a permanent solution).
32-bit Node reports warnings for bson and kerberos.
I don't understand why is node-gyp even being fired. I thought that native packages come pre-built, with binaries for my OS?
Hmm, I guess I thought wrong.
...
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
Make sure you have all the required software to run node-gyp:
You can configure version of Visual Studio used by gyp via an environment variable so you can avoid having to set the --msvs_version=2012 property every time you do an npm install.
Examples:
GYP_MSVS_VERSION=2012 for Visual Studio 2012 GYP_MSVS_VERSION=2013e (the 'e' stands for 'express edition') For the full list see - https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294
This is still painful for Windows users of NodeJS as it assumes you have a copy of Visual Studio installed and many end users will never have this. So I'm lobbying Joyent to the encourage them to include web sockets as part of CORE node and also to possible ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem.
Feel free to add your vote at: