5
respostas

NodeJs usando Banco de Dados Oracle

Galera, alguem já desenvolveu alguma API usando banco de dados Oracle.

Estou seguindo os passos informado no https://github.com/oracle/node-oracledb/blob/master/INSTALL.md, aparentemente fiz todas as configurações porém ainda permance esse erro ao executar:

npm install oracledb

segue Erro:

C:\Projetos_Nodejs\Payfast>npm install oracledb

> oracledb@1.12.2 install C:\Projetos_Nodejs\Payfast\node_modules\oracledb
> node-gyp rebuild


C:\Projetos_Nodejs\Payfast\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 "" rebuild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformTo
olsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 w
as not found. Install the required version of Windows SDK or change the SDK ver
sion in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [C:\Projetos_Nodejs\Payfast\node_modules\oracledb\buil
d\oracledb.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` fail
ed 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: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:\Projetos_Nodejs\Payfast\node_modules\oracledb
gyp ERR! node -v v6.10.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN payfast@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.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! oracledb@1.12.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oracledb@1.12.2 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:\Projetos_Nodejs\Payfast\npm-debug.log

C:\Projetos_Nodejs\Payfast>
5 respostas

Bom, ele pediu para instalar o tal do windows sdk 8, vc fez?

Olá Alberto, tudo bem? que honra rs

Então, realmente não tinha me atentado a isso, pois achei que não precisaria, pois não encontrei essa instalação na especificação do GIT, após a instalação do SDK 8.1, apareceu outro erro.

Sabe o que pode ser?


C:\Projetos_Nodejs\Payfast>npm install oracledb

> oracledb@1.12.2 install C:\Projetos_Nodejs\Payfast\node_modules\oracledb
> node-gyp rebuild


C:\Projetos_Nodejs\Payfast\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 "" rebuild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
TRACKER : error TRK0005: Failed to locate: "CL.exe". O sistema não pode encontr
ar o arquivo especificado. [C:\Projetos_Nodejs\Payfast\node_modules\oracledb\bu
ild\oracledb.vcxproj]


gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` fail
ed 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: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:\Projetos_Nodejs\Payfast\node_modules\oracledb
gyp ERR! node -v v6.10.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN payfast@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.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! oracledb@1.12.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oracledb@1.12.2 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:\Projetos_Nodejs\Payfast\npm-debug.log

C:\Projetos_Nodejs\Payfast>

Opa Marcelo, não vou negar, não manjo de oracle nem do ambiente necessário. De todo jeito, achei essa página aqui => https://community.oracle.com/docs/DOC-931127 . Talvez ela te ajude, pode dar uma olhada? Acho que precisa de mais dependências na máquina.

Maravilha Alberto, estou analisando e vendo tudo... realmente o Oracle é muito chato pra configurar, uma pena, pois serviços integrados com Oracle ficaram execelentes, mas vamos lá, estou configurando tudo e espero conseguir resolver logo pra continuar o curso.

Alberto, Sucesso cara, aparentemente foi. Vou começar a desenvolver meu modules pra testar o acesso ao Oracle.

Eu segui, o link: https://community.oracle.com/docs/DOC-931127

e Finalizei pelo: http://stackoverflow.com/questions/32556295/npm-install-error-the-build-tools-for-v120-platform-toolset-v120-cannot

C:\Projetos_Nodejs\Payfast\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 "" rebuild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
  njsOracle.cpp
  njsPool.cpp
  njsConnection.cpp
  njsResultSet.cpp
  njsMessages.cpp
  njsIntLob.cpp
  dpiEnv.cpp
  dpiEnvImpl.cpp
  dpiException.cpp
  dpiExceptionImpl.cpp
  dpiConnImpl.cpp
  dpiDateTimeArrayImpl.cpp
  dpiPoolImpl.cpp
  dpiStmtImpl.cpp
  dpiUtils.cpp
  dpiLob.cpp
  dpiCommon.cpp
  win_delay_load_hook.cc
     Creating library C:\Projetos_Nodejs\Payfast\node_modules\oracledb\build\Re
  lease\oracledb.lib and object C:\Projetos_Nodejs\Payfast\node_modules\oracled
  b\build\Release\oracledb.exp
  Generating code
  Finished generating code
  oracledb.vcxproj -> C:\Projetos_Nodejs\Payfast\node_modules\oracledb\build\Re
  lease\\oracledb.node
  oracledb.vcxproj -> C:\Projetos_Nodejs\Payfast\node_modules\oracledb\build\Re
  lease\oracledb.pdb (Full PDB)
payfast@1.0.0 C:\Projetos_Nodejs\Payfast
`-- oracledb@1.12.2
  `-- nan@2.4.0

npm WARN payfast@1.0.0 No repository field.

C:\Projetos_Nodejs\Payfast>