2017-06-09 250 views
-1

我試圖安裝oracledb npm,但是出現錯誤。安裝oracledb時出現錯誤npm

enter image description here

已經安裝:

  • 的NodeJS v6.11.0
  • NPM 3.10.10
  • 蟒蛇2.7
  • 的Visual Studio 14
  • 即時客戶對Oracle 64位
  • 窗10的64位

在系統環境變量

  • 路徑= C:\甲骨文\ instantclient
  • 路徑= C:\程序文件(x86)\的NodeJS \
  • Path = C:\ Program Files(x86)\ Java \ jdk1.6.0_11 \ bin
  • Path = C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ bin
  • OCI_INC_DIR = C:\甲骨文\ instantclient \ SDK \包括
  • OCI_LIB_DIR = C:\甲骨文\ instantclient \ SDK \ lib中\ MSVC
  • 路徑= C:\ Python27 \

ERROR:

C:\>npm install oracledb 

> [email protected] install C:\node_modules\oracledb 
> node-gyp rebuild 


C:\node_modules\oracledb>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) else (node "" rebuild) 
Traceback (most recent call last): 
    File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module> 
    sys.exit(gyp.script_main()) 
    File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main 
    return main(sys.argv[1:]) 
    File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main 
    return gyp_main(args) 
    File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 514, in gyp_main 
    options.duplicate_basename_check) 
    File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 98, in Load 
    generator.CalculateVariables(default_variables, params) 
    File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1900, in CalculateVariables 
    generator_flags.get('msvs_version', 'auto')) 
    File "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion 
    versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) 
KeyError: '2014' 
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1 
gyp ERR! stack  at ChildProcess.onCpExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:305:16) 
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_process.js:215:12) 
gyp ERR! System Windows_NT 10.0.10586 
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" 
gyp ERR! cwd C:\node_modules\oracledb 
gyp ERR! node -v v6.11.0 
gyp ERR! node-gyp -v v3.4.0 
gyp ERR! not ok 
npm ERR! Windows_NT 10.0.10586 
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "oracledb" 
npm ERR! node v6.11.0 
npm ERR! npm v3.10.10 
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:\npm-debug.log 
+0

輸出說確保你有最新版本的節點和NPM,但你似乎使用節點5.4.11。還要確保您的Node版本是64位,以匹配您安裝的Oracle客戶端。 – jpmc26

+0

@ jpmc26將npm和node.js升級到最新版本,但仍會出現相同的錯誤。 –

+0

@ jpmc26 node.js和oracle客戶端都是64位。 –

回答

1

更改MSVS版本:

NPM配置一套msvs_version 2015年

這對我的作品。

0

問題是您正在使用不受支持的版本節點

節點的版本您使用的是5。**和Oracle數據庫模塊支持節點4,6和7

源是模塊的git

請升級節點版本6或7

電源外殼:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force 
npm install -g npm-windows-upgrade 
npm-windows-upgrade 

或用NVM:

nvm install 6 
nvm use 6 

在環境變量確保的Python 2.7是被指着並且只有2.7。*。

無需卸載所有其他pythones版本。

更新我如何去;

祝你好運,

+0

'-Scope Process'會改變執行策略而不會對系統造成任何副作用。 – jpmc26

+0

與運行相同: powershell.exe -ExecutionPolicy Bypass,在執行未簽名腳本時完成 – sBanda

+0

沒有不需要的副作用,關閉PS會話後它將成爲默認行爲。 – sBanda