目前我的系统中安装了一个MongoDB,它与我的PHP项目配合得很好。但是,当我为sailsjs安装mongodb适配器时,它给了我一个错误
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=2012',
gyp info spawn args '-I',
gyp info spawn args 'C:\\web\\app\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Rusty Orange\\AppData\\Roaming\\npm\\node_modu
les\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\Rusty Orange\\.node-gyp\\0.10.25\\common.gypi'
,
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\Rusty Orange\\.node-gyp\\0.10.
25',
gyp info spawn args '-Dmodule_root_dir=C:\\web\\app',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\web\\app\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: C:\web\app) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error:
gyp`失败,退出代码:1
gyp ERR!在ChildProcess.onCpExit堆栈(C:\ Users \ Rusty Orange \ AppData \ Roami
纳克\ NPM \ node_modules \节点-GYP \ lib中\ configure.js:343:16)
gyp ERR!在ChildProcess.EventEmitter.emit堆栈(events.js:98:17)
gyp ERR! Process.ChildProcess._handle.onexit(child_process.js:797:
12)
gyp ERR!系统Windows_NT 6.2.9200
gyp ERR!命令"节点" " C:\ Users \ Rusty Orange \ AppData \ Roaming \ npm \ node_mo
dules \节点-GYP \ BIN \节点gyp.js" "重建" " - msvs_version = 2012"
gyp ERR! cwd C:\ web \ app
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v1.0.2
gyp ERR!不行
C:\web\app>npm install sails-mongo -msvs_version=2012
npm http GET https://registry.npmjs.org/sails-mongo
npm http 304 https://registry.npmjs.org/sails-mongo
npm http GET https://registry.npmjs.org/waterline-errors
npm http GET https://registry.npmjs.org/mongodb/1.4.4
npm http GET https://registry.npmjs.org/waterline-cursor
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/waterline-cursor
npm http 304 https://registry.npmjs.org/mongodb/1.4.4
npm http 304 https://registry.npmjs.org/waterline-errors
npm http GET https://registry.npmjs.org/kerberos/0.0.3
npm http GET https://registry.npmjs.org/bson/0.2.8
npm http 304 https://registry.npmjs.org/kerberos/0.0.3
npm http 304 https://registry.npmjs.org/bson/0.2.8
> kerberos@0.0.3 install C:\web\app\node_modules\sails-mongo\node_modules\mongod
b\node_modules\kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\kerberos>n
ode "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modul
es\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.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.t
argets(64,5): error MSB8020: The build tools for Visual Studio 2012 (Platform T
oolset = 'v110') cannot be found. To build using the v110 build tools, please i
nstall Visual Studio 2012 build tools. Alternatively, you may upgrade to the c
urrent Visual Studio tools by selecting the Project menu or right-click the sol
ution, and then selecting "Upgrade Solution...". [C:\web\app\node_modules\sails
-mongo\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan
> bson@0.2.8 install C:\web\app\node_modules\sails-mongo\node_modules\mongodb\no
de_modules\bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\bson>node
"C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\n
ode-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.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.t
argets(64,5): error MSB8020: The build tools for Visual Studio 2012 (Platform T
oolset = 'v110') cannot be found. To build using the v110 build tools, please i
nstall Visual Studio 2012 build tools. Alternatively, you may upgrade to the c
urrent Visual Studio tools by selecting the Project menu or right-click the sol
ution, and then selecting "Upgrade Solution...". [C:\web\app\node_modules\sails
-mongo\node_modules\mongodb\node_modules\bson\build\bson.vcxproj]
sails-mongo@0.10.4 node_modules\sails-mongo
├── waterline-errors@0.10.0-rc1
├── async@0.8.0
├── waterline-cursor@0.0.5 (async@0.9.0)
├── lodash@2.4.1
└── mongodb@1.4.4 (kerberos@0.0.3, bson@0.2.8)
C:\web\app>npm install sails-mongo --save
npm http GET https://registry.npmjs.org/sails-mongo
npm http 304 https://registry.npmjs.org/sails-mongo
npm http GET https://registry.npmjs.org/mongodb/1.4.4
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/waterline-cursor
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/waterline-errors
npm http 304 https://registry.npmjs.org/waterline-errors
npm http 304 https://registry.npmjs.org/mongodb/1.4.4
npm http 304 https://registry.npmjs.org/waterline-cursor
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/bson/0.2.8
npm http GET https://registry.npmjs.org/kerberos/0.0.3
npm http 304 https://registry.npmjs.org/bson/0.2.8
npm http 304 https://registry.npmjs.org/kerberos/0.0.3
> kerberos@0.0.3 install C:\web\app\node_modules\sails-mongo\node_modules\mongod
b\node_modules\kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\kerberos>n
ode "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modul
es\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.
kerberos.cc
worker.cc
security_credentials.cc
security_buffer.cc
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C450
6: no definition for inline function 'v8::Persistent<v8::Object> v8::Persistent
<v8::Object>::New(v8::Handle<v8::Object>)' (..\lib\win32\worker.cc) [C:\web\app
\node_modules\sails-mongo\node_modules\mongodb\node_modules\kerberos\build\kerb
eros.vcxproj]
security_buffer_descriptor.cc
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(184): warning C450
6: no definition for inline function 'v8::Persistent<v8::Object> v8::Persistent
<v8::Object>::New(v8::Handle<v8::Object>)' (..\lib\win32\kerberos.cc) [C:\web\a
pp\node_modules\sails-mongo\node_modules\mongodb\node_modules\kerberos\build\ke
rberos.vcxproj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(184): warning C450
6: no definition for inline function 'v8::Persistent<v8::FunctionTemplate> v8::
Persistent<v8::FunctionTemplate>::New(v8::Handle<v8::FunctionTemplate>)' (..\li
b\win32\kerberos.cc) [C:\web\app\node_modules\sails-mongo\node_modules\mongodb\
node_modules\kerberos\build\kerberos.vcxproj]
security_context.cc
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc (..\lib\win32\wrappers\security_buffer.cc) [C:\web\app\node_modul
es\sails-mongo\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxpro
j]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc (..\lib\win32\wrappers\security_credentials.cc) [C:\web\app\node_
modules\sails-mongo\node_modules\mongodb\node_modules\kerberos\build\kerberos.v
cxproj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(218): warning C450
6: no definition for inline function 'v8::Persistent<v8::Object> v8::Persistent
<v8::Object>::New(v8::Handle<v8::Object>)' (..\lib\win32\wrappers\security_buff
er.cc) [C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\k
erberos\build\kerberos.vcxproj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(218): warning C450
6: no definition for inline function 'v8::Persistent<v8::FunctionTemplate> v8::
Persistent<v8::FunctionTemplate>::New(v8::Handle<v8::FunctionTemplate>)' (..\li
b\win32\wrappers\security_buffer.cc) [C:\web\app\node_modules\sails-mongo\node_
modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc (..\lib\win32\wrappers\security_buffer_descriptor.cc) [C:\web\app
\node_modules\sails-mongo\node_modules\mongodb\node_modules\kerberos\build\kerb
eros.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc (..\lib\win32\wrappers\security_context.cc) [C:\web\app\node_modu
les\sails-mongo\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxpr
oj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C450
6: no definition for inline function 'v8::Persistent<v8::Object> v8::Persistent
<v8::Object>::New(v8::Handle<v8::Object>)' (..\lib\win32\wrappers\security_cred
entials.cc) [C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modu
les\kerberos\build\kerberos.vcxproj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C450
6: no definition for inline function 'v8::Persistent<v8::FunctionTemplate> v8::
Persistent<v8::FunctionTemplate>::New(v8::Handle<v8::FunctionTemplate>)' (..\li
b\win32\wrappers\security_credentials.cc) [C:\web\app\node_modules\sails-mongo\
node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(218): warning C450
6: no definition for inline function 'v8::Persistent<v8::Object> v8::Persistent
<v8::Object>::New(v8::Handle<v8::Object>)' (..\lib\win32\wrappers\security_buff
er_descriptor.cc) [C:\web\app\node_modules\sails-mongo\node_modules\mongodb\nod
e_modules\kerberos\build\kerberos.vcxproj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(218): warning C450
6: no definition for inline function 'v8::Persistent<v8::FunctionTemplate> v8::
Persistent<v8::FunctionTemplate>::New(v8::Handle<v8::FunctionTemplate>)' (..\li
b\win32\wrappers\security_buffer_descriptor.cc) [C:\web\app\node_modules\sails-
mongo\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C450
6: no definition for inline function 'v8::Persistent<v8::Object> v8::Persistent
<v8::Object>::New(v8::Handle<v8::Object>)' (..\lib\win32\wrappers\security_cont
ext.cc) [C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\
kerberos\build\kerberos.vcxproj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C450
6: no definition for inline function 'v8::Persistent<v8::FunctionTemplate> v8::
Persistent<v8::FunctionTemplate>::New(v8::Handle<v8::FunctionTemplate>)' (..\li
b\win32\wrappers\security_context.cc) [C:\web\app\node_modules\sails-mongo\node
_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
kerberos_sspi.c
base64.c
Creating library C:\web\app\node_modules\sails-mongo\node_modules\mongodb\
node_modules\kerberos\build\Release\kerberos.lib and object C:\web\app\node_m
odules\sails-mongo\node_modules\mongodb\node_modules\kerberos\build\Release\k
erberos.exp
Generating code
Finished generating code
kerberos.vcxproj -> C:\web\app\node_modules\sails-mongo\node_modules\mongodb\
node_modules\kerberos\build\Release\\kerberos.node
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan
> bson@0.2.8 install C:\web\app\node_modules\sails-mongo\node_modules\mongodb\no
de_modules\bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\bson>node
"C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\n
ode-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 12.0\VC\include\xlocale(337): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_mo
dules\bson\build\bson.vcxproj]
C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\bson\node
_modules\nan\nan.h(1103): warning C4267: 'initializing' : conversion from 'size
_t' to 'int', possible loss of data [C:\web\app\node_modules\sails-mongo\node_m
odules\mongodb\node_modules\bson\build\bson.vcxproj]
C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\bson\node
_modules\nan\nan.h(1117): warning C4267: 'initializing' : conversion from 'size
_t' to 'int', possible loss of data [C:\web\app\node_modules\sails-mongo\node_m
odules\mongodb\node_modules\bson\build\bson.vcxproj]
..\ext\bson.cc(891): warning C4267: 'argument' : conversion from 'size_t' to 'u
int32_t', possible loss of data [C:\web\app\node_modules\sails-mongo\node_modul
es\mongodb\node_modules\bson\build\bson.vcxproj]
C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\bson\node
_modules\nan\nan.h(950): warning C4244: 'argument' : conversion from 'int64_t'
to 'double', possible loss of data [C:\web\app\node_modules\sails-mongo\node_mo
dules\mongodb\node_modules\bson\build\bson.vcxproj]
..\ext\bson.cc(560) : see reference to function template instantiatio
n 'v8::Local<v8::Number> NanNew<v8::Number,int64_t>(P)' being compiled
with
[
P=int64_t
]
..\ext\bson.cc(313): warning C4267: 'initializing' : conversion from 'size_t' t
o 'uint32_t', possible loss of data [C:\web\app\node_modules\sails-mongo\node_m
odules\mongodb\node_modules\bson\build\bson.vcxproj]
..\ext\bson.cc(142) : while compiling class template member function
'void BSONSerializer<CountStream>::SerializeValue(void *,const v8::Handle<v8:
:Value> &)'
..\ext\bson.cc(112) : see reference to function template instantiatio
n 'void BSONSerializer<CountStream>::SerializeValue(void *,const v8::Handle<v
8::Value> &)' being compiled
..\ext\bson.cc(92) : while compiling class template member function '
void BSONSerializer<CountStream>::SerializeDocument(const v8::Handle<v8::Valu
e> &)'
..\ext\bson.cc(869) : see reference to function template instantiatio
n 'void BSONSerializer<CountStream>::SerializeDocument(const v8::Handle<v8::V
alue> &)' being compiled
..\ext\bson.cc(868) : see reference to class template instantiation '
BSONSerializer<CountStream>' being compiled
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C450
6: no definition for inline function 'v8::Persistent<v8::Object> v8::Persistent
<v8::Object>::New(v8::Handle<v8::Object>)' [C:\web\app\node_modules\sails-mongo
\node_modules\mongodb\node_modules\bson\build\bson.vcxproj]
C:\Users\Rusty Orange\.node-gyp\0.10.25\deps\v8\include\v8.h(179): warning C450
6: no definition for inline function 'v8::Persistent<v8::FunctionTemplate> v8::
Persistent<v8::FunctionTemplate>::New(v8::Handle<v8::FunctionTemplate>)' [C:\we
b\app\node_modules\sails-mongo\node_modules\mongodb\node_modules\bson\build\bso
n.vcxproj]
Creating library C:\web\app\node_modules\sails-mongo\node_modules\mongodb\
node_modules\bson\build\Release\bson.lib and object C:\web\app\node_modules\s
ails-mongo\node_modules\mongodb\node_modules\bson\build\Release\bson.exp
Generating code
Finished generating code
bson.vcxproj -> C:\web\app\node_modules\sails-mongo\node_modules\mongodb\node
_modules\bson\build\Release\\bson.node
sails-mongo@0.10.4 node_modules\sails-mongo
├── waterline-errors@0.10.0-rc1
├── async@0.8.0
├── waterline-cursor@0.0.5 (async@0.9.0)
├── lodash@2.4.1
└── mongodb@1.4.4 (kerberos@0.0.3, bson@0.2.8)
C:\web\app>`
它与Visual Studio有冲突吗?还是我错过了什么?
答案 0 :(得分:3)
您在系统上安装了哪个版本的nodejs。这是使sailjs版本与nodejs版本冲突的错误。
检查所有依赖项,然后您可以继续。
您可以使用nvm(节点版本管理器)直接更改nodejs的版本。
祝你好运。
答案 1 :(得分:1)
不,只是使用nvm更改npm版本我不是在告诉nodejs软件版本..
在互联网上搜索nvm,你会得到一个想法
感谢。
答案 2 :(得分:1)
检查所有依赖项,然后您可以继续。
您可以使用nvm(节点版本管理器)直接更改nodejs的版本。