Bamboo errors when running a batch file, but I can run it manually

I have a batch file with the 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 this batch file to install oracledb through Bamboo.

When I run this batch file manually, everything installs fine and everyone is happy. However, when I get Bamboo to run the same batch file, I get the 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 the projects in this solution one at a time. To enable parallel build, please add the "/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 with exit code: 1 error 15-Oct-2015 16:53:08 gyp ERR! stack at 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 at ChildProcess.emit (events.js:110:17) error 15-Oct-2015 16:53:08 gyp ERR! stack at 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 should be a difference between a regular Windows environment and a bamboo environment, which I just don’t ask. I have the following environment variables set in the 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 anyone can help, it will be very appreciated.

+5
source share
1 answer

Run: node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\nβ€Œβ€‹ode-gyp.js" rebuild . This should result in an error.

If it does NOT produce an error, npm_config_node_gyp can be changed to cdd Bamboo. In this case, set the correct value as an environment variable.

If it node.h error, check the node.h file or the src folder in the %USERPROFILE%/.node-gyp/ , I hope it will not exist, and reinstalling node-gyp should make it work.

0
source

Source: https://habr.com/ru/post/1233758/


All Articles