我正在尝试为nodejs安装oracle包。 它让我低于C ++编译的错误。
$ npm install oracle
npm WARN package.json test-seriate@1.0.0 No description
npm WARN package.json test-seriate@1.0.0 No repository field.
npm WARN package.json test-seriate@1.0.0 No README data
> oracle@0.3.8 install C:\demo\test-seriate\node_modules\oracle
> node-gyp rebuild
C:\demo\test-seriate\node_modules\oracle>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
connection.cpp
oracle_bindings.cpp
executeBaton.cpp
reader.cpp
statement.cpp
outParam.cpp
c:\program files (x86)\windows kits\8.1\include\shared\rpcndr.h(178): error C2632: 'char' followed by 'int' is illegal (..\src\statement.cpp) [C:\demo\test-seriate\node_modules\oracle\build\oracle_bindings.vcxproj]
c:\program files (x86)\windows kits\8.1\include\shared\rpcndr.h(178): warning C4091: 'typedef ' : ignored on left of 'unsigned char' when no variable is declared (..\src\statement.cpp) [C:\demo\test-seriate\node_modules\oracle\build\oracle_bindings.vcxproj]
c:\program files (x86)\windows kits\8.1\include\shared\rpcndr.h(178): error C2632: 'char' followed by 'int' is illegal (..\src\outParam.cpp) [C:\demo\test-seriate\node_modules\oracle\build\oracle_bindings.vcxproj]
c:\program files (x86)\windows kits\8.1\include\shared\rpcndr.h(178): warning C4091: 'typedef ' : ignored on left of 'unsigned char' when no variable is declared (..\src\outParam.cpp) [C:\demo\test-seriate\node_modules\oracle\build\oracle_bindings.vcxproj]
c:\program files (x86)\windows kits\8.1\include\shared\rpcndr.h(178): error C2632: 'char' followed by 'int' is illegal (..\src\reader.cpp) [C:\demo\test-seriate\node_modules\oracle\build\oracle_bindings.vcxproj]
c:\program files (x86)\windows kits\8.1\include\shared\rpcndr.h(178): warning C4091: 'typedef ' : ignored on left of 'unsigned char' when no variable is declared (..\src\reader.cpp) [C:\demo\test-seriate\node_modules\oracle\build\oracle_bindings.vcxproj]
c:\program files (x86)\windows kits\8.1\include\shared\rpcndr.h(178): error C2632: 'char' followed by 'int' is illegal (..\src\oracle_bindings.cpp) [C:\demo\test-seriate\node_modules\oracle\build\oracle_bindings.vcxproj]
我能做些什么来克服这个问题?
正如评论中所建议的,我试图安装oracledb。仍然在同一个问题上运行。
$ npm install oracledb
npm WARN package.json test-seriate@1.0.0 No description
npm WARN package.json test-seriate@1.0.0 No repository field.
npm WARN package.json test-seriate@1.0.0 No README data
> oracledb@1.1.0 install C:\demo\test-seriate\node_modules\oracled b
> node-gyp rebuild
C:\demo\test-seriate\node_modules\oracledb>if not defined npm_conf ig_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\no de-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable pa rallel build, please add the "/m" switch.
njsOracle.cpp
njsPool.cpp
njsConnection.cpp
njsResultSet.cpp
njsMessages.cpp
njsIntLob.cpp
dpiEnv.cpp
dpiEnvImpl.cpp
dpiException.cpp
dpiExceptionImpl.cpp
dpiConnImpl.cpp
dpiDateTimeArrayImpl.cpp
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 326): error C2995: 'v8::Local<T> Nan::imp::NanEnsureHandleOrPersis tent(const v8::Local<T> &)' : function template has already been d efined (..\src\njs\src\njsPool.cpp) [C:\demo\test-seriate\node_mod ules\oracledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\ nan\nan.h(319) : see declaration of 'Nan::imp::NanEnsureHandleOrPe rsistent'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 346): error C2995: 'v8::Local<T> Nan::imp::NanEnsureLocal(const v8 ::Local<T> &)' : function template has already been defined (..\sr c\njs\src\njsPool.cpp) [C:\demo\test-seriate\node_modules\oracledb \build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\ nan\nan.h(334) : see declaration of 'Nan::imp::NanEnsureLocal'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C3083: 'smalloc': the symbol to the left of a '::' mus t be a type (..\src\njs\src\njsPool.cpp) [C:\demo\test-seriate\nod e_modules\oracledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C2039: 'FreeCallback' : is not a member of 'node' (..\ src\njs\src\njsPool.cpp) [C:\demo\test-seriate\node_modules\oracle db\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C2061: syntax error : identifier 'FreeCallback' (..\sr c\njs\src\njsPool.cpp) [C:\demo\test-seriate\node_modules\oracledb \build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 761): error C2065: 'callback' : undeclared identifier (..\src\njs\ src\njsPool.cpp) [C:\demo\test-seriate\node_modules\oracledb\build \oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 761): error C2065: 'hint' : undeclared identifier (..\src\njs\src\ njsPool.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\ora cledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 768): error C2665: 'node::Buffer::New' : none of the 4 overloads c ould convert all the argument types (..\src\njs\src\njsPool.cpp) [ C:\demo\test-seriate\node_modules\oracledb\build\oracledb.vcxproj]
C:\Users\singhal\.node-gyp\4.0.0\include\node\node_buffe r.h(43): could be 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8 ::Isolate *,char *,size_t)'
C:\Users\singhal\.node-gyp\4.0.0\include\node\node_buffe r.h(31): or 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8 ::Isolate *,v8::Local<v8::String>,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 772): error C2664: 'v8::Local<v8::Object>::Local(const v8::Local<v 8::Object> &)' : cannot convert argument 1 from 'v8::MaybeLocal<v8 ::Object>' to 'const v8::Local<v8::Object> &' (..\src\njs\src\njsP ool.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\oracled b.vcxproj]
Reason: cannot convert from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object>'
No user-defined-conversion operator available that can p erform this conversion, or the operator cannot be called
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 779): error C2039: 'Use' : is not a member of 'node::Buffer' (..\s rc\njs\src\njsPool.cpp) [C:\demo\test-seriate\node_modules\oracled b\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 779): error C3861: 'Use': identifier not found (..\src\njs\src\njs Pool.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\oracle db.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 326): error C2995: 'v8::Local<T> Nan::imp::NanEnsureHandleOrPersis tent(const v8::Local<T> &)' : function template has already been d efined (..\src\njs\src\njsIntLob.cpp) [C:\demo\test-seriate\node_m odules\oracledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\ nan\nan.h(319) : see declaration of 'Nan::imp::NanEnsureHandleOrPe rsistent'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 326): error C2995: 'v8::Local<T> Nan::imp::NanEnsureHandleOrPersis tent(const v8::Local<T> &)' : function template has already been d efined (..\src\njs\src\njsConnection.cpp) [C:\demo\test-seriate\no de_modules\oracledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\ nan\nan.h(319) : see declaration of 'Nan::imp::NanEnsureHandleOrPe rsistent'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 346): error C2995: 'v8::Local<T> Nan::imp::NanEnsureLocal(const v8 ::Local<T> &)' : function template has already been defined (..\sr c\njs\src\njsIntLob.cpp) [C:\demo\test-seriate\node_modules\oracle db\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\ nan\nan.h(334) : see declaration of 'Nan::imp::NanEnsureLocal'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 346): error C2995: 'v8::Local<T> Nan::imp::NanEnsureLocal(const v8 ::Local<T> &)' : function template has already been defined (..\sr c\njs\src\njsConnection.cpp) [C:\demo\test-seriate\node_modules\or acledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\ nan\nan.h(334) : see declaration of 'Nan::imp::NanEnsureLocal'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 326): error C2995: 'v8::Local<T> Nan::imp::NanEnsureHandleOrPersis tent(const v8::Local<T> &)' : function template has already been d efined (..\src\njs\src\njsResultSet.cpp) [C:\demo\test-seriate\nod e_modules\oracledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\ nan\nan.h(319) : see declaration of 'Nan::imp::NanEnsureHandleOrPe rsistent'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 346): error C2995: 'v8::Local<T> Nan::imp::NanEnsureLocal(const v8 ::Local<T> &)' : function template has already been defined (..\sr c\njs\src\njsResultSet.cpp) [C:\demo\test-seriate\node_modules\ora cledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\ nan\nan.h(334) : see declaration of 'Nan::imp::NanEnsureLocal'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C3083: 'smalloc': the symbol to the left of a '::' mus t be a type (..\src\njs\src\njsIntLob.cpp) [C:\demo\test-seriate\n ode_modules\oracledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C2039: 'FreeCallback' : is not a member of 'node' (..\ src\njs\src\njsIntLob.cpp) [C:\demo\test-seriate\node_modules\orac ledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C3083: 'smalloc': the symbol to the left of a '::' mus t be a type (..\src\njs\src\njsConnection.cpp) [C:\demo\test-seria te\node_modules\oracledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C2061: syntax error : identifier 'FreeCallback' (..\sr c\njs\src\njsIntLob.cpp) [C:\demo\test-seriate\node_modules\oracle db\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C2039: 'FreeCallback' : is not a member of 'node' (..\ src\njs\src\njsConnection.cpp) [C:\demo\test-seriate\node_modules\ oracledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 761): error C2065: 'callback' : undeclared identifier (..\src\njs\ src\njsIntLob.cpp) [C:\demo\test-seriate\node_modules\oracledb\bui ld\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C2061: syntax error : identifier 'FreeCallback' (..\sr c\njs\src\njsConnection.cpp) [C:\demo\test-seriate\node_modules\or acledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 761): error C2065: 'hint' : undeclared identifier (..\src\njs\src\ njsIntLob.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\o racledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 761): error C2065: 'callback' : undeclared identifier (..\src\njs\ src\njsConnection.cpp) [C:\demo\test-seriate\node_modules\oracledb \build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 768): error C2665: 'node::Buffer::New' : none of the 4 overloads c ould convert all the argument types (..\src\njs\src\njsIntLob.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\oracledb.vcxpro j]
C:\Users\singhal\.node-gyp\4.0.0\include\node\node_buffe r.h(43): could be 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8 ::Isolate *,char *,size_t)'
C:\Users\singhal\.node-gyp\4.0.0\include\node\node_buffe r.h(31): or 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8 ::Isolate *,v8::Local<v8::String>,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C3083: 'smalloc': the symbol to the left of a '::' mus t be a type (..\src\njs\src\njsResultSet.cpp) [C:\demo\test-seriat e\node_modules\oracledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 761): error C2065: 'hint' : undeclared identifier (..\src\njs\src\ njsConnection.cpp) [C:\demo\test-seriate\node_modules\oracledb\bui ld\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 772): error C2664: 'v8::Local<v8::Object>::Local(const v8::Local<v 8::Object> &)' : cannot convert argument 1 from 'v8::MaybeLocal<v8 ::Object>' to 'const v8::Local<v8::Object> &' (..\src\njs\src\njsI ntLob.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\oracl edb.vcxproj]
Reason: cannot convert from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object>'
No user-defined-conversion operator available that can p erform this conversion, or the operator cannot be called
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C2039: 'FreeCallback' : is not a member of 'node' (..\ src\njs\src\njsResultSet.cpp) [C:\demo\test-seriate\node_modules\o racledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 768): error C2665: 'node::Buffer::New' : none of the 4 overloads c ould convert all the argument types (..\src\njs\src\njsConnection. cpp) [C:\demo\test-seriate\node_modules\oracledb\build\oracledb.vc xproj]
C:\Users\singhal\.node-gyp\4.0.0\include\node\node_buffe r.h(43): could be 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8 ::Isolate *,char *,size_t)'
C:\Users\singhal\.node-gyp\4.0.0\include\node\node_buffe r.h(31): or 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8 ::Isolate *,v8::Local<v8::String>,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 779): error C2039: 'Use' : is not a member of 'node::Buffer' (..\s rc\njs\src\njsIntLob.cpp) [C:\demo\test-seriate\node_modules\oracl edb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 757): error C2061: syntax error : identifier 'FreeCallback' (..\sr c\njs\src\njsResultSet.cpp) [C:\demo\test-seriate\node_modules\ora cledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 772): error C2664: 'v8::Local<v8::Object>::Local(const v8::Local<v 8::Object> &)' : cannot convert argument 1 from 'v8::MaybeLocal<v8 ::Object>' to 'const v8::Local<v8::Object> &' (..\src\njs\src\njsC onnection.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\o racledb.vcxproj]
Reason: cannot convert from 'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object>'
No user-defined-conversion operator available that can p erform this conversion, or the operator cannot be called
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 779): error C3861: 'Use': identifier not found (..\src\njs\src\njs IntLob.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\orac ledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 761): error C2065: 'callback' : undeclared identifier (..\src\njs\ src\njsResultSet.cpp) [C:\demo\test-seriate\node_modules\oracledb\ build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 779): error C2039: 'Use' : is not a member of 'node::Buffer' (..\s rc\njs\src\njsConnection.cpp) [C:\demo\test-seriate\node_modules\o racledb\build\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 761): error C2065: 'hint' : undeclared identifier (..\src\njs\src\ njsResultSet.cpp) [C:\demo\test-seriate\node_modules\oracledb\buil d\oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 779): error C3861: 'Use': identifier not found (..\src\njs\src\njs Connection.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\ oracledb.vcxproj]
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 768): error C2665: 'node::Buffer::New' : none of the 4 overloads c ould convert all the argument types (..\src\njs\src\njsResultSet.c pp) [C:\demo\test-seriate\node_modules\oracledb\build\oracledb.vcx proj]
C:\Users\singhal\.node-gyp\4.0.0\include\node\node_buffe r.h(43): could be 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8 ::Isolate *,char *,size_t)'
C:\Users\singhal\.node-gyp\4.0.0\include\node\node_buffe r.h(31): or 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8 ::Isolate *,v8::Local<v8::String>,node::encoding)'
while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)'
C:\demo\test-seriate\node_modules\oracledb\node_modules\nan\nan.h( 772): error C2664: 'v8::Local<v8::Object>::Local(const v8::Local<v 8::Object> &)' : cannot convert argument 1 from 'v8::MaybeLocal<v8 ::Object>' to 'const v8::Local<v8::Object> &' (..\src\njs\src\njsR esultSet.cpp) [C:\demo\test-seriate\node_modules\oracledb\build\or acledb.vcxproj]
这可能是因为它无法找到oracledb.vcxproj吗?