我有一个批处理文件,内容如下:
@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
我使用这个批处理文件通过Bamboo安装OracleDB。
当我手动运行这个批处理文件时,一切都能正常安装并且一切顺利。然而,当我让Bamboo运行完全相同的批处理文件时,我会遇到以下错误:
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
我想可能是我没有正确设置常规Windows环境和Bamboo环境之间的差异。我在Bamboo任务中设置了以下环境变量:
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"
我该如何修复这个问题?