0

I am trying to install oracledb in node js, but as I run the command

>npm install oracledb

After these commands:

> oracledb@1.11.0 install D:\xyz\XYZApp\npm\node_modules\oracledb
> node-gyp rebuild

An error occures:

D:\xyz\XYZApp\npm\node_modules\oracledb>if not defined npm_config_node_gyp
 (node "C:\Users\abc\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-
bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebui
ld )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: self signed certificate in certificate chain
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
gyp ERR! stack     at emitNone (events.js:67:13)
gyp ERR! stack     at TLSSocket.emit (events.js:166:7)
gyp ERR! stack     at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._
finishInit (_tls_wrap.js:582:8)
gyp ERR! stack     at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ss
l.onhandshakedone (_tls_wrap.js:424:38)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\abc\
\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp
.js" "rebuild"
gyp ERR! cwd D:\xyz\XYZApp\npm\node_modules\oracledb
gyp ERR! node -v v4.4.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

npm WARN enoent ENOENT: no such file or directory, open 'D:\xyz\XYZApp\npm
\node_modules\instantclient_12_1\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'D:\xyz\XYZApp\npm
\node_modules\node-v4.4.3\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'D:\xyz\XYZApp\npm
\node_modules\sdk\package.json'
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\abc\\Ap
pData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "oracledb"
npm ERR! node v4.4.3
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! oracledb@1.11.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oracledb@1.11.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the oracledb 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 information on how to open an issue for this project with:
npm ERR!     npm bugs oracledb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls oracledb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\xyz\XYZApp\npm\npm-debug.log

I have tried many solutions given on internet viz:

npm install --global npm
npm install --global --production windows-build-tools
npm install instantclient
set PATH=%cd%\instantclient;%PATH%
set OCI_LIB_DIR=%cd%\instantclient\sdk\lib\msvc
set OCI_INC_DIR=%cd%\instantclient\sdk\include
npm install oracledb

Still getting the same error,not able to resolve the issue. Anyone can help to get the solution.

Installation Prerequisites:

  • Python 2.7 C Compiler with support for C++ 11 (Xcode, gcc, Visual Studio or similar)

    The small, free Oracle Instant Client "basic" and "SDK" packages if your database is remote. Or use the libraries and headers from a locally installed database such as the free Oracle XE

    Release Set OCI_LIB_DIR and OCI_INC_DIR during installation if the Oracle libraries and headers are in a non-default location Run npm

    Install oracledb to install from the NPM regis

    try.

1 Answers1

0

The TLSSocket error could indicate that npm is trying to get to the network (to install required dependencies) but is being blocked by your network. Do you need to set http_proxy or https_proxy environment variable?

Also, if you are OK with 3rd party binaries, look at the prebuilt Windows node-oracledb binaries at https://github.com/oracle/node-oracledb/issues/18

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48