tulinn_a tulinn_a - 4 months ago 44
Node.js Question

Certificate error was raised when installing oracledb in Electron app

I am running Windows 7 with oracledb v1.10.0, electron-prebuilt v1.2.2, electron-rebuild v1.1.5, node v0.12.7, and npm v2.11.3. When I execute

node_modules/.bin/electron-rebuild -f -w oracledb
, I receive the following error:

gyp ERR! stack Error: certificate not trusted
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket.<anonymous> (_tls_wrap.js:929:36)
gyp ERR! stack at TLSSocket.emit (events.js:104:17)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:460:8)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "H:\\electron-quick-start\\node_modules\\electron-rebuild\\node_modules\\npm\\node_modules\\node
-gyp\\bin\\node-gyp.js" "install" "--target=1.2.7" "--arch=x64" "--dist-url=https://gh-contractor-zcbenz.s3.amazonaws.co
m/atom-shell/dist"
gyp ERR! cwd H:\electron-quick-start
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok


How can I get this command to successfully execute?

Answer

The certificate error I was getting was due to being behind a corporate firewall under Windows. To solve that, I replaced the dist-url value https://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist with http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist. The other error I was getting was (as mentioned by @Thennarasan) "Module did not self-register" and to solve that I called the following commands and it worked:

PS H:\electron-app> cd node_modules\oracledb
PS H:\electron-app\node_modules\oracledb> node-gyp rebuild --target=1.2.8 --arch=x64 --target_platform=win --dist-url=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist --msvs_version=2013
PS H:\electron-app> cd ..\..