2016-08-19 74 views
0

我有一個簡單的node.js服務器和一些應用程序,它們應該連接到Oracle數據庫。爲此,我決定使用node-oracledb驅動程序,但是我在安裝時遇到了一些問題。我遵循Oracle webpagegithub上的指示,但我仍然在下面發生錯誤。安裝node-oracledb時出錯

我的環境配置:

  • 的Windows 8.1專業版64位
  • node.js的V6.4.0
  • NPM v3.10.3
  • MS的Visual Studio 2013社區版
  • Python的V2。 7.12
  • Oracle Instant Client(基本+ SDK)v12.1.0.2.0

節點,Python和Oracle Instant Client文件夾包含在PATH變量中。 OCI_LIB_DIR和OCI_INC_DIR也根據github指令進行設置。

這裏的問題:當我執行命令npm install oracledb -g,出現以下錯誤:

> [email protected] install C:\Users\pr\AppData\Roaming\npm\node_modules\ora 
cledb 
> node-gyp rebuild 


C:\Users\pr\AppData\Roaming\npm\node_modules\oracledb>if not defined npm_c 
onfig_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\ 
\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) else (node "" rebuild) 

Building the projects in this solution one at a time. To enable parallel build, 
please add the "/m" switch. 
C:\Users\pr\AppData\Roaming\npm\node_modules\oracledb\build\oracledb.vcxp 
roj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" 
was not found. Confirm that the path in the <Import> declaration is correct, a 
nd that the file exists on disk. 
gyp ERR! build error 
gyp ERR! stack Error: `msbuild` failed with exit code: 1 
gyp ERR! stack  at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ 
npm\node_modules\node-gyp\lib\build.js:276:23) 
gyp ERR! stack  at emitTwo (events.js:106:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:191:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/child_proces 
s.js:204:12) 
gyp ERR! System Windows_NT 6.3.9600 
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej 
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" 
gyp ERR! cwd C:\Users\pr\AppData\Roaming\npm\node_modules\oracledb 
gyp ERR! node -v v6.4.0 
gyp ERR! node-gyp -v v3.3.1 
gyp ERR! not ok 
npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ 
node_modules\\npm\\bin\\npm-cli.js" "install" "oracledb" "-g" 
npm ERR! node v6.4.0 
npm ERR! npm v3.10.3 
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!  C:\Users\pr\Development\Visual Studio 2013\npm-debug.log 

我真的不知道去哪裏找,在一個解決方案。什麼可能導致該錯誤? node/oracle client/python之間是否有已知的不兼容性?

一件事:github上指示說:

確保微軟的Visual Studio環境變量適當設置 。使用set PATH並驗證它包含您的Visual Studio 路徑。如果它們未設置,請使用vcvars64.bat(或vcvars.bat,如果您使用32位二進制文​​件構建 )來設置環境。

應該設置哪些VS環境變量以及哪些VS路徑應該完全包含在PATH中?

回答

0

嘗試更新NPM到最新版本:

npm install -g npm 

如果仍然無效,請嘗試包括像這樣的VS版本:

npm install oracledb --msvs_version=2013 
+0

不,沒有運氣... – peterremec

+1

同樣的問題,我探微放棄這個廢話NPM模塊! – Wifsimster

1

模塊一樣OracleDB的或節點OracleDB的需求編輯。編譯需要像C編譯器,Python等軟件。

我正面臨與oracldb模塊相同的問題。按照下面的說明進行操作,就像魅力一樣

https://community.oracle.com/docs/DOC-931127