node.js - Bamboo errors when running batch file, but I can run it manually fine -


i have batch file following contents:

@echo on echo "start" echo "${bamboo.agentworkingdirectory}" call "c:\program files (x86)\microsoft visual studio 11.0\common7\tools\vsdevcmd.bat" cd "${bamboo.build.working.directory}/server" call npm install --msvs_version=2012 exit 

i use batch file install oracledb via bamboo.

when run batch file manually, installs fine , happy. however, when bamboo run exact same batch file, following error:

build   15-oct-2015 16:53:04    e:\bamboo-agent-home\xml-data\build-dir\ec-ecb-be\server\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 )  build   15-oct-2015 16:53:06    building projects in solution 1 @ time. enable parallel build, please add "/m" switch. build   15-oct-2015 16:53:06      njsoracle.cpp build   15-oct-2015 16:53:06      njspool.cpp build   15-oct-2015 16:53:07      njsconnection.cpp build   15-oct-2015 16:53:07      njsmessages.cpp build   15-oct-2015 16:53:07      dpienv.cpp build   15-oct-2015 16:53:07      dpienvimpl.cpp build   15-oct-2015 16:53:07      dpiexception.cpp build   15-oct-2015 16:53:07      dpiexceptionimpl.cpp build   15-oct-2015 16:53:07      dpiconnimpl.cpp build   15-oct-2015 16:53:07      dpidatetimearrayimpl.cpp build   15-oct-2015 16:53:07      dpipoolimpl.cpp build   15-oct-2015 16:53:07      dpistmtimpl.cpp build   15-oct-2015 16:53:07      dpiutils.cpp build   15-oct-2015 16:53:07    e:\bamboo-agent-home\xml-data\build-dir\ec-ecb-be\server\node_modules\oracledb\src\njs\src\njsconnection.h(54): fatal error c1083: cannot open include file: 'node.h': no such file or directory (..\src\njs\src\njsconnection.cpp) [e:\bamboo-agent-home\xml-data\build-dir\ec-ecb-be\server\node_modules\oracledb\build\oracledb.vcxproj] build   15-oct-2015 16:53:07    ..\src\njs\src\njspool.cpp(51): fatal error c1083: cannot open include file: 'node.h': no such file or directory [e:\bamboo-agent-home\xml-data\build-dir\ec-ecb-be\server\node_modules\oracledb\build\oracledb.vcxproj] build   15-oct-2015 16:53:07    ..\src\njs\src\njsoracle.cpp(51): fatal error c1083: cannot open include file: 'node.h': no such file or directory [e:\bamboo-agent-home\xml-data\build-dir\ec-ecb-be\server\node_modules\oracledb\build\oracledb.vcxproj] error   15-oct-2015 16:53:08    gyp err! build error  error   15-oct-2015 16:53:08    gyp err! stack error: `msbuild` failed exit code: 1 error   15-oct-2015 16:53:08    gyp err! stack     @ childprocess.onexit (c:\program files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23) error   15-oct-2015 16:53:08    gyp err! stack     @ childprocess.emit (events.js:110:17) error   15-oct-2015 16:53:08    gyp err! stack     @ process.childprocess._handle.onexit (child_process.js:1074:12) error   15-oct-2015 16:53:08    gyp err! system windows_nt 6.1.7601 error   15-oct-2015 16:53:08    gyp err! command "node" "c:\\program files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" error   15-oct-2015 16:53:08    gyp err! cwd e:\bamboo-agent-home\xml-data\build-dir\ec-ecb-be\server\node_modules\oracledb error   15-oct-2015 16:53:08    gyp err! node -v v0.12.7 error   15-oct-2015 16:53:08    gyp err! node-gyp -v v2.0.1 error   15-oct-2015 16:53:08    gyp err! not ok  error   15-oct-2015 16:53:08    npm err! windows_nt 6.1.7601 error   15-oct-2015 16:53:08    npm err! argv "c:\\program files\\nodejs\\\\node.exe" "c:\\program files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--msvs_version=2012" error   15-oct-2015 16:53:08    npm err! node v0.12.7 error   15-oct-2015 16:53:08    npm err! npm  v2.11.3 

there must difference between regular windows environment , bamboo environment i'm not setting. have following environment variables set in bamboo task:

temp="c:\temp" tmp="c:\temp" gyp_msvs_version="2012"    oci_lib_dir="c:\oracle\instantclient\sdk\lib\msvc"    oci_inc_dir="c:\oracle\instantclient\sdk\include" 

if out, appreciated.

run: node "c:\program files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\n‌​ode-gyp.js" rebuild. should produce error.

if not produce error, npm_config_node_gyp might getting modified cwd bamboo. in case, set correct value environment variable.

if give out error, check node.h file or src folder in %userprofile%/.node-gyp/ directory, not exist , re-installing node-gyp should make work.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -