2

oracledb在 Windows 7 上安装时遇到了很多问题。我收到以下错误:

> oracledb@1.13.1 install C:\Users\alex.cauthen\Documents\CLA\cla_ui\node_module
s\oracledb
> node-gyp rebuild


C:\Users\alex.cauthen\Documents\CLA\cla_ui\node_modules\oracledb>if not defined
npm_config_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 "" rebu
ild )
Traceback (most recent call last):
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_m
ain.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "C:\Program Files\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\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\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\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\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\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: '2017'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_module
s\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_proces
s.js:215:12)
gyp ERR! System Windows_NT 6.1.7601
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\alex.cauthen\Documents\CLA\cla_ui\node_modules\oracledb
gyp ERR! node -v v6.10.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
cla_ui@1.0.0 C:\Users\alex.cauthen\Documents\CLA\cla_ui
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm WARN cla_ui@1.0.0 No description
npm WARN cla_ui@1.0.0 No repository field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "oracledb"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

为了安装 oracledb,我遵循了以下演练:https ://community.oracle.com/docs/DOC-931127 。这是我所做的:

  • 我安装了 Visual Studio 2012
  • 我安装了 python 2.7
  • 我有节点 6.10.2 和 npm 3.10.10
  • 我已经安装了 oracle Instant Client Basic 和 sdk,将它们解压缩到 C:\oracle\instantclient 中的一个 Instantclient 文件夹中
  • 路径环境。变量 = C:\Program Files\nodejs\;C:\Python27\;C:\oracle\instantclient;
  • 创建环境。变量 OCI_LIB_DIR = C:\oracle\instantclient\sdk\lib\msvc
  • 创建环境。变量 OCI_INC_DIR = C:\oracle\instantclient\sdk\include

然后我在安装完所有这些之后做的最后一件事就是 do npm install oracledb。我不知道该怎么做。我浪费了很多时间调试/尝试安装它。如果您看到我错过的任何内容,请告诉我...并感谢您的帮助。

亚历克斯

4

0 回答 0