node.js - NodeJS : npm install oracle, 无法在 Windows 7 32 位上编译

标签 node.js npm node-oracledb

在Windows 7/8上编译oracle似乎有很多类似的问题,但大多数都与没有设置Python或OCI环境变量有关。我已经这样做了两天了,没有运气。希望有人能提供一些建议...

Windows 7,32 位
GNU bash v3.1.0(1)
Node v0.10.29
NPM v1.4.14
Oracle InstantClient 12.1.0.1.0
Python 2.7.5
Visual Studio 2012 Express 桌面版

我设置了以下变量:

OCI_VERSION=12  <-- Tried (10,11 and 12)
OCI_LIB_DIR=C:\InstantClient\sdk\lib\msvc\vc11
OCI_INCLUDE_DIR=C:\InstantClient\sdk\include
PATH= ...<existing path>;C:\InstantClient\vc11;C:\InstantClient\

我设置了npm config set python C:\Python27

我确认未设置 PYTHON 环境变量。 (虽然我之前尝试过设置它)

这是我得到的:

$ npm install oracle
-

> oracle@0.3.7 install c:\Sites\new\node_modules\oracle
> node-gyp rebuild

c:\Sites\new\node_modules\oracle>node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild \
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack     at errnoException (child_process.js:1000:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:791:34)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Sites\new\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.7601
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "oracle"
npm ERR! cwd c:\Sites\new
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:\Sites\new\npm-debug.log
npm ERR! not ok code 0

这是 npm-debug.log 的尾部。

103 info preinstall oracle@0.3.7
104 verbose readDependencies using package.json deps
105 verbose readDependencies using package.json deps
106 silly resolved []
107 verbose about to build c:\Sites\new\node_modules\oracle
108 info build c:\Sites\new\node_modules\oracle
109 verbose linkStuff [ false, false, false, 'c:\\Sites\\new\\node_modules' ]
110 info linkStuff oracle@0.3.7
111 verbose linkBins oracle@0.3.7
112 verbose linkMans oracle@0.3.7
113 verbose rebuildBundles oracle@0.3.7
114 info install oracle@0.3.7
115 verbose unsafe-perm in lifecycle true
116 info oracle@0.3.7 Failed to exec install script
117 info c:\Sites\new\node_modules\oracle unbuild
118 info preuninstall oracle@0.3.7
119 info uninstall oracle@0.3.7
120 verbose true,c:\Sites\new\node_modules,c:\Sites\new\node_modules unbuild oracle@0.3.7
121 info postuninstall oracle@0.3.7
122 error oracle@0.3.7 install: `node-gyp rebuild`
122 error Exit status 1
123 error Failed at the oracle@0.3.7 install script.
123 error This is most likely a problem with the oracle package,
123 error not with npm itself.
123 error Tell the author that this fails on your system:
123 error     node-gyp rebuild
123 error You can get their info via:
123 error     npm owner ls oracle
123 error There is likely additional logging output above.
124 error System Windows_NT 6.1.7601
125 error command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "oracle"
126 error cwd c:\Sites\new
127 error node -v v0.10.29
128 error npm -v 1.4.14
129 error code ELIFECYCLE
130 verbose exit [ 1, true ]

虽然我使用的是 git 附带的 GNU bash,但我也通过 Windows 命令提示符进行了尝试,得到了相同的结果。

我昨天在该项目的 github 页面上发布了此内容,但希望获得更广泛的受众,他们可能知道我在编译此模块时缺少什么。

最佳答案

这不是您问题的直接答案,但如果您熟悉 C#,可以选择在进程中调用 .NET 并利用 .NET 成熟的数据库生态系统。引用我的回答here .

关于node.js - NodeJS : npm install oracle, 无法在 Windows 7 32 位上编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24532858/

相关文章:

node.js - 永远使用 npm start 和环境变量

node.js - 从 docker 容器内发布 NPM 包

node.js - BLOB 随机返回为 LOB 和 Buffer

node.js - 测试从 nodejs 应用程序到 Oracle DB 的连接

node.js - NestJS 初创公司的开发速度慢得令人难以置信

javascript - 认知 + API 网关。获取状态 4​​01

npm - 在 electron@1.8.2 安装后脚本失败

node.js - Polymer 和 npm,更新到最新版本

npm - 通过 npm/webpack 加载预构建模块的调试版本

javascript - 无法读取未定义的属性 "rid"