2016-11-04 60 views
0

我試圖在節點JS安裝OracleDB的安裝OracleDB的,但是當我運行命令得到錯誤,而在的NodeJS

>npm install oracledb 

這些命令後:

> [email protected] install D:\xyz\XYZApp\npm\node_modules\oracledb 
> node-gyp rebuild 

錯誤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! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 

我已經嘗試了許多解決方案在互聯網上給予:

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 

仍然得到了同樣的錯誤,不能夠解決問題。任何人都可以幫助解決問題。

安裝先決條件:

  • 的Python 2.7 C編譯器與C++ 11(Xcode中,GCC,視覺 Studio或類似)

    小,自由Oracle即時客戶端的 「基本」 支持和「SDK」包,如果你的數據庫是遠程的,則爲 。或者使用從 本地安裝的數據庫庫和頭文件,如免費的Oracle XE

    版本集OCI_LIB_DIR和OCI_INC_DIR安裝過程中,如果 Oracle庫和頭文件是在非缺省位置運行NPM

    安裝OracleDB的從NPM雷吉斯

    試安裝。

回答

0

TLSSocket錯誤可能表明npm試圖進入網絡(安裝所需的依賴項),但正在被您的網絡阻止。你需要設置http_proxy或https_proxy環境變量嗎?

另外,如果您對第三方二進制文件還可以,請查看位於https://github.com/oracle/node-oracledb/issues/18的預構建Windows節點oracledb二進制文件