新人请教链接oracle
发布于 10 年前 作者 hc2014 7710 次浏览 最后一次编辑是 8 年前

node怎么链接oracle呢?不管是windos 还是linux 都没搞成功,各种问题,请老大指点一二,目前是在linux 系统上安装,如果能在winwos 上安装更好; linux 安装报错信息如下: make:进入目录’/usr/local/lib/node_modules/oracle/build’ CXX(target) Release/obj.target/oracle_bindings/src/connection.o CXX(target) Release/obj.target/oracle_bindings/src/oracle_bindings.o CXX(target) Release/obj.target/oracle_bindings/src/executeBaton.o CXX(target) Release/obj.target/oracle_bindings/src/reader.o CXX(target) Release/obj.target/oracle_bindings/src/statement.o CXX(target) Release/obj.target/oracle_bindings/src/outParam.o SOLINK_MODULE(target) Release/obj.target/oracle_bindings.node /usr/bin/ld: cannot find -locci /usr/bin/ld: cannot find -lclntsh /usr/bin/ld: cannot find -lnnz11 collect2: error: ld returned 1 exit status make: *** [Release/obj.target/oracle_bindings.node] 错误 1 make:离开目录“/usr/local/lib/node_modules/oracle/build” gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12) gyp ERR! System Linux 3.13.0-29-generic gyp ERR! command “nodejs” “/usr/bin/node-gyp” "rebuild" gyp ERR! cwd /usr/local/lib/node_modules/oracle gyp ERR! node -v v0.10.25 gyp ERR! node-gyp -v v0.10.10 gyp ERR! not ok npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian

npm ERR! weird error 1 npm ERR! not ok code 0 在线等啊

12 回复

node-oracle需要py2.7、C++、oracle客户端等环境支持,在windows上要先安装好环境才可以 https://github.com/joeferner/node-oracle#basic-installation

这些环境我都有了 win 上我有vs2010 vs2012 vc++组建都装了 oracle10g py2.7 都在,我换win7系统 把报错信息贴出来

这些环境我都有了 win 上我有vs2010 vs2012 vc++组建都装了 oracle10g py2.7 都在,我换win7系统 把报错信息贴出来 ; oracle@0.3.7 install C:\Users\hc\node_modules\oracle node-gyp rebuild

\Users\hc\node_modules\oracle>node “D:\Program Files\nodejs\node_modules\npm
\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp.js” rebuild 此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 connection.cpp oracle_bindings.cpp executeBaton.cpp reader.cpp \users\hc\node_modules\oracle\src\connection.h(11): fatal error C1083: 无法打 包括 件:“occi.h”: No such file or directory [C:\Users\hc\node_modules\oracle\bui o cle_bindings.vcxproj] \users\hc\node_modules\oracle\src\connection.h(11): fatal error C1083: 无法打 包括 件:“occi.h”: No such file or directory [C:\Users\hc\node_modules\oracle\bui o cle_bindings.vcxproj] statement.cpp \users\hc\node_modules\oracle\src\connection.h(11): fatal error C1083: 无法打 包括 件:“occi.h”: No such file or directory [C:\Users\hc\node_modules\oracle\bui o cle_bindings.vcxproj] outParam.cpp \users\hc\node_modules\oracle\src\executeBaton.h(12): fatal error C1083: 无法 开 括文件:“occi.h”: No such file or directory [C:\Users\hc\node_modules\oracle ild racle_bindings.vcxproj] \users\hc\node_modules\oracle\src\connection.h(11): fatal error C1083: 无法打 包括 件:“occi.h”: No such file or directory [C:\Users\hc\node_modules\oracle\bui o cle_bindings.vcxproj] \users\hc\node_modules\oracle\src\connection.h(11): fatal error C1083: 无法打 包括 件:“occi.h”: No such file or directory [C:\Users\hc\node_modules\oracle\bui o cle_bindings.vcxproj] p ERR! build error p ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.ex failed with exit code: 1 p ERR! stack at ChildProcess.onExit (D:\Program Files\nodejs\node_modules m\node_modules\node-gyp\lib\build.js:267:23) RR! stack at ChildProcess.emit (events.js:98:17) p ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809 ) p ERR! System Windows_NT 6.1.7600 p ERR! command "node" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_mod s\\node-gyp\\bin\\node-gyp.js" "rebuild" p ERR! cwd C:\Users\hc\node_modules\oracle p ERR! node -v v0.10.29 p ERR! node-gyp -v v0.13.1 p ERR! not ok m ERR! oracle@0.3.7 install:node-gyp rebuild` m ERR! Exit status 1 m ERR! m ERR! Failed at the oracle@0.3.7 install script. m ERR! This is most likely a problem with the oracle package, m ERR! not with npm itself. m ERR! Tell the author that this fails on your system: m ERR! node-gyp rebuild m ERR! You can get their info via: m ERR! npm owner ls oracle m ERR! There is likely additional logging output above.

m ERR! System Windows_NT 6.1.7600 m ERR! command “D:\Program Files\nodejs\\node.exe” “D:\Program Files\no s\node_modules\npm\bin\npm-cli.js” “install” "oracle" m ERR! cwd C:\Users\hc m ERR! node -v v0.10.29 m ERR! npm -v 1.4.14 m ERR! code ELIFECYCLE m ERR! m ERR! Additional logging details can be found in: m ERR! C:\Users\hc\npm-debug.log m ERR! not ok code 0

来大神帮我看看呀

D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\hc\node _modules\oracle\build \oracle_bindings.vcxproj] D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\hc\node _modules\oracle\build \oracle_bindings.vcxproj] D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\hc\node _modules\oracle\build \oracle_bindings.vcxproj] D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\hc\node _modules\oracle\build \oracle_bindings.vcxproj] …\src\oracle_bindings.cpp(103): warning C4244: “=”: 从“double”转换到“uint3 2_t”,可能丢 失数据 [C:\Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\oracle_bindings.cpp(169): warning C4244: “=”: 从“double”转换到“uint3 2_t”,可能丢 失数据 [C:\Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\executeBaton.cpp(91): warning C4244: “初始化”: 从“double”转换到“int ”,可能丢失数据 [C: \Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\executeBaton.cpp(92): warning C4244: “初始化”: 从“double”转换到“int ”,可能丢失数据 [C: \Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\executeBaton.cpp(93): warning C4244: “初始化”: 从“double”转换到“int ”,可能丢失数据 [C: \Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\executeBaton.cpp(94): warning C4244: “初始化”: 从“double”转换到“int ”,可能丢失数据 [C: \Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\executeBaton.cpp(95): warning C4244: “初始化”: 从“double”转换到“int ”,可能丢失数据 [C: \Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\executeBaton.cpp(96): warning C4244: “初始化”: 从“double”转换到“int ”,可能丢失数据 [C: \Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\executeBaton.cpp(97): warning C4244: “初始化”: 从“double”转换到“int ”,可能丢失数据 [C: \Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\reader.cpp(57): warning C4244: “初始化”: 从“double”转换到“int”,可 能丢失数据 [C:\Users \hc\node_modules\oracle\build\oracle_bindings.vcxproj] C:\Users\hc.node-gyp\0.10.29\deps\v8\include\v8.h(184): warning C4506: 内联函数 “v8 ::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定义 [C:\Users\hc\nod e_mo dules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::Object ] C:\Users\hc.node-gyp\0.10.29\deps\v8\include\v8.h(184): warning C4506: 内联函数 “v8 ::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定义 [C:\Users\hc\nod e_mo dules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::FunctionTemplate ] C:\Users\hc.node-gyp\0.10.29\deps\v8\include\v8.h(184): warning C4506: 内联函数 “v8 ::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定义 [C:\Users\hc\nod e_mo dules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::Object ] C:\Users\hc.node-gyp\0.10.29\deps\v8\include\v8.h(184): warning C4506: 内联函数 “v8 ::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定义 [C:\Users\hc\nod e_mo dules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::FunctionTemplate ] C:\Users\hc.node-gyp\0.10.29\deps\v8\include\v8.h(184): warning C4506: 内联函数 “v8 ::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定义 [C:\Users\hc\nod e_mo dules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::Object ] …\src\connection.cpp(182): warning C4244: “初始化”: 从“double”转换到“int” ,可能丢失数据 [C:
Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] statement.cpp …\src\connection.cpp(192): warning C4101: “ex”: 未引用的局部变量 [C:\Users\hc \node_mod ules\oracle\build\oracle_bindings.vcxproj] outParam.cpp …\src\connection.cpp(590): warning C4244: “=”: 从“double”转换到“unsigned i nt”,可能丢失 数据 [C:\Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xmemory(212): warning C4506: 内联函数“v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定 义 [C:\Us ers\hc\node_modules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::Object \ ] D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xmemory(212): warning C4506: 内联函数“v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定 义 [C:\Us ers\hc\node_modules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::FunctionTemplate ] D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\hc\node _modules\oracle\build \oracle_bindings.vcxproj] D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc [C:\Users\hc\node _modules\oracle\build \oracle_bindings.vcxproj] …\src\outParam.cpp(30): warning C4244: “=”: 从“double”转换到“int”,可能丢 失数据 [C:\Users \hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\outParam.cpp(37): warning C4244: “=”: 从“double”转换到“int”,可能丢 失数据 [C:\Users \hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\outParam.cpp(44): warning C4244: “=”: 从“double”转换到“int”,可能丢 失数据 [C:\Users \hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\outParam.cpp(52): warning C4244: “=”: 从“double”转换到“float”,可能 丢失数据 [C:\Use rs\hc\node_modules\oracle\build\oracle_bindings.vcxproj] …\src\outParam.cpp(52): warning C4244: “=”: 从“int”转换到“float”,可能丢 失数据 [C:\Users
hc\node_modules\oracle\build\oracle_bindings.vcxproj] C:\Users\hc.node-gyp\0.10.29\deps\v8\include\v8.h(184): warning C4506: 内联函数 “v8 ::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定义 [C:\Users\hc\nod e_mo dules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::Object ] C:\Users\hc.node-gyp\0.10.29\deps\v8\include\v8.h(184): warning C4506: 内联函数 “v8 ::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定义 [C:\Users\hc\nod e_mo dules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::FunctionTemplate ] C:\Users\hc.node-gyp\0.10.29\deps\v8\include\v8.h(184): warning C4506: 内联函数 “v8 ::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定义 [C:\Users\hc\nod e_mo dules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::Object ] C:\Users\hc.node-gyp\0.10.29\deps\v8\include\v8.h(184): warning C4506: 内联函数 “v8 ::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)”没有定义 [C:\Users\hc\nod e_mo dules\oracle\build\oracle_bindings.vcxproj] with [ T=v8::FunctionTemplate ] LINK : fatal error LNK1181: 无法打开输入文件“C:\instantclient_11_2\sdk\lib\msvc \vc9\ora occi10.lib” [C:\Users\hc\node_modules\oracle\build\oracle_bindings.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (D:\Program Files\nodejs\node_modules
npm\node_modules\node-gyp\lib\build.js:267:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:

gyp ERR! System Windows_NT 6.1.7600 gyp ERR! command “node” “D:\Program Files\nodejs\node_modules\npm\node_modu les\node-gyp\bin\node-gyp.js” "rebuild" gyp ERR! cwd C:\Users\hc\node_modules\oracle gyp ERR! node -v v0.10.29 gyp ERR! node-gyp -v v0.13.1 gyp ERR! not ok npm ERR! oracle@0.3.7 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the oracle@0.3.7 install script. npm ERR! This is most likely a problem with the oracle package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls oracle npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7600 npm ERR! command “D:\Program Files\nodejs\\node.exe” “D:\Program Files\nod ejs\node_modules\npm\bin\npm-cli.js” “install” "oracle" npm ERR! cwd C:\Users\hc npm ERR! node -v v0.10.29 npm ERR! npm -v 1.4.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\hc\npm-debug.log npm ERR! not ok code 0

windows 没成功坑太多 你可以参考http://my.oschina.net/zenglingfan/blog/164390 linux 下还算顺利 你是不是少个Oracle instant client没装

请教一下,我也碰到这个问题了。如何解决啊???

@ssyz1988 请教一下,我也碰到这个问题了。如何解决啊???

@ssyz1988 请教一下,我也碰到这个问题了。如何解决啊???

我的情况如下: window 7 visual studio 2010 ,oracle client 10 编译成功,npm install oracle成功 ,但访问数据出错,有大神说个法么:

错误不详细,看不出什么: the specifield module could not be found 用node-gyp编译成功,直接用visual studio编译也成功,还需要什么模块?

@zhichuanlee 我再win7上没有弄成功 只在linux上成功了。 你的这个错误信息不是说了吗the specifield module could not be found 差 specifield 这个东西吧

@hc2014 有 specified 这个模块? 我昨天才开始装环境,specified不是module名称吧

回到顶部