0

语境

我正在尝试通过为我的项目(在公司防火墙后面)运行 npm install oracledb 来安装 node-oracledb 模块。我有正确的代理设置!(y)

但它不断抛出以下错误:

λ yarn add oracledb
yarn add v1.7.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error C:\Users\<username>\Documents\<path>\test\test-oracle\node_modules\oracledb: Command failed.
Exit code: 87
Command: node package/oracledbinstall.js
Arguments:
Directory: C:\Users\<username>\Documents\<path>\test\test-oracle\node_modules\oracledb
Output:
oracledb Beginning installation
oracledb Verifying installation
oracledb Continuing installation
oracledb ERR! NJS-054: Binary build/Release/oracledb.node was not installed.
oracledb ERR! Pre-built binary packages are not available for this version of Node.js (NODE_MODULE_VERSION="59")
oracledb ERR! Failed to install binary package oracledb-v2.3.0-node-v59-win32-x64.gz
oracledb ERR! connect ETIMEDOUT 192.30.255.113:443
oracledb ERR! For help see https://oracle.github.io/node-oracledb/INSTALL.html#troubleshooting
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

npm

λ npm 安装 oracledb

> oracledb@2.3.0 install C:\Users\<username>\Documents\<path>\test\test-oracle\test-oracledb\node_modules\oracledb
> node package/oracledbinstall.js

oracledb Beginning installation
oracledb Verifying installation
oracledb Continuing installation
oracledb ERR! NJS-054: Binary build/Release/oracledb.node was not installed.
oracledb ERR! Pre-built binary packages are not available for this version of Node.js (NODE_MODULE_VERSION="59")
oracledb ERR! Failed to install binary package oracledb-v2.3.0-node-v59-win32-x64.gz
oracledb ERR! connect ETIMEDOUT 192.30.255.113:443
oracledb ERR! For help see https://oracle.github.io/node-oracledb/INSTALL.html#troubleshooting

npm WARN test-oracledb@1.0.0 No description
npm WARN test-oracledb@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 87
npm ERR! oracledb@2.3.0 install: `node package/oracledbinstall.js`
npm ERR! Exit status 87
npm ERR!
npm ERR! Failed at the oracledb@2.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\<username>\AppData\Roaming\npm-cache\_logs\2018-06-11T19_17_03_152Z-debug.log

RCA 和调查结果

查看oracledbinstall.js负责“安装”模块的脚本后,我可以立即看到一个问题。

该脚本以以下内容开头:在此处输入图像描述

所以我相当肯定,当它试图与 Github 联系以获取 oracledb 模块运行所需的二进制文件和其他脚本时,它会被我的防火墙阻止

解析度?

所以我想知道是否有任何方法可以成功实现这一点。

4

2 回答 2

1

我在npm install oracledb公司防火墙后面运行同样的问题。配置证书没有帮助,但是当我把它放在同一行时它就起作用了。我还指定了出现此错误时需要哪些二进制文件:

oracledb ERR! Pre-built binary packages are not available for this version of Node.js (NODE_MODULE_VERSION="59")
oracledb ERR! Failed to install binary package oracledb-v2.3.0-node-v59-win32-x64.gz
. 
. 
.
npm ERR! oracledb@2.3.0 install: `node package/oracledbinstall.js`
npm ERR! Exit status 87
npm ERR!
npm ERR! Failed at the oracledb@2.3.0 install script.

我的决心:

我能够用这条线安装它:

npm install --cafile "/path/to/myCA.cert" oracle/node-oracledb.git#v2.3.0

我希望这能够帮助遇到这个问题的人。

于 2019-08-01T23:23:46.940 回答
0
于 2018-06-12T02:54:32.733 回答