我尝试在需要node-gyp
的Windows上安装npm的任何内容都会出错。我尝试重新安装node-gyp github页面上建议的所有windows内容。
为什么我会收到这些错误?这是尝试安装mongodb
PS C:\Users\Farzher\Documents\Dev\nodejs\abc> npm install mongodb
npm WARN package.json prelude-ls-extended@0.0.0 No description
npm http GET https://registry.npmjs.org/mongodb
npm http 304 https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/bson/0.2.5
npm http GET https://registry.npmjs.org/kerberos/0.0.3
npm http 304 https://registry.npmjs.org/bson/0.2.5
npm http 304 https://registry.npmjs.org/kerberos/0.0.3
> kerberos@0.0.3 install C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos>node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-
bin\\..\..\node_modules\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
security_buffer_descriptor.cc
security_context.cc
c:\users\farzher\node_modules\mongodb\node_modules\kerberos\lib\win32\worker.h(17): error C2146: syntax error : missing
';' before identifier 'request' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
c:\users\farzher\node_modules\mongodb\node_modules\kerberos\lib\win32\worker.h(17): error C4430: missing type specifier
- int assumed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\bui
ld\kerberos.vcxproj]
c:\users\farzher\node_modules\mongodb\node_modules\kerberos\lib\win32\worker.h(17): error C4430: missing type specifier
- int assumed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\bui
ld\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
but unwind semantics are not enabled. Specify /EHsc [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build
\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
but unwind semantics are not enabled. Specify /EHsc [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build
\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
but unwind semantics are not enabled. Specify /EHsc [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build
\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
but unwind semantics are not enabled. Specify /EHsc [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build
\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(82): error C2146: syntax error : missing ';' before
identifier 'SEC_WCHAR' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(82): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(82): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(83): error C2146: syntax error : missing ';' before
identifier 'SEC_CHAR' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(83): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(83): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(86): error C2146: syntax error : missing ';' before
identifier 'SECURITY_STATUS' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(86): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(86): error C4430: missing type specifier - int assum
ed. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.
vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(105): error C2143: syntax error : missing ';' before
'*' [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(105): error C4430: missing type specifier - int assu
med. Note: C++ does not support default-int [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos
.vcxproj]
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\sspi.h(105): error C2378: 'SEC_CHAR' : redefinition; symbol
cannot be overloaded with a typedef [C:\Users\Farzher\node_modules\mongodb\node_modules\kerberos\build\kerberos.vcxpro
答案 0 :(得分:-2)
您的计算机上需要使用Python才能使用gyp,AFAIK。