2015-10-15 11 views
5

Ho un file batch con i seguenti contenuti:errori di bambù durante l'esecuzione di file batch, ma posso eseguirlo manualmente bene

@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 

Io uso questo file batch per installare OracleDb via di bambù.

Quando eseguo questo file batch manualmente, tutto si installa e tutto è felice. Tuttavia, quando ottengo di bambù per eseguire lo stesso file esatto batch, ottengo il seguente errore:

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 

Ci deve essere una differenza tra il normale ambiente Windows e l'ambiente di bambù che sto semplicemente non l'impostazione. Ho le seguenti variabili d'ambiente impostate nell'attività 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" 

Se qualcuno potesse dare una mano, sarebbe molto apprezzato.

+0

L'offerta di birra e pizza è reale? –

+0

Sì, assolutamente. Questo mi tormenta ancora di più e ho immaginato che questo potesse essere un buon incentivo: P –

risposta

0

Corsa: node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\n‌​ode-gyp.js" rebuild. Questo dovrebbe produrre un errore.

Se NON genera un errore, npm_config_node_gyp potrebbe essere modificato in cwd da Bamboo. In questo caso, impostare il valore corretto come variabile di ambiente.

Se non dare fuori un errore, verificare la presenza di node.h file o una cartella nella directory src%USERPROFILE%/.node-gyp/, speriamo che non esisterà e reinstallare node-gyp dovrebbe farlo funzionare.

+0

Hmm, questo è un vantaggio abbastanza buono dai suoni di esso. L'esecuzione del 'nodo" C: \ Programmi \ nodejs \ node_modules \ npm \ bin \ node-gyp-bin \\ .. \ .. \ node_modules \ node-gyp \ bin \ n ode-gyp.js "ricostruisce' fa in effetti produce l'errore Tuttavia, quando cerco 'node.h' e la cartella' src' posso trovarli entrambi. Esiste in '% USERPROFILE% /. Node-gyp/0.12.7/src'. Potrebbe essere possibile che Bamboo non li veda? Se è così, come posso impostarlo? L'errore che ottengo quando si esegue il comando di ricostruzione è: 'gyp: binding.gyp non trovato (cwd: C: \ Windows \ system32) durante il tentativo di caricare binding.gyp' –

+0

Inoltre, l'esecuzione del comando di ricostruzione fallisce anche dopo reinstallare node-gyp (con lo stesso errore che ho elencato prima). –

+0

Provare a eseguire il comando di ricostruzione con: 'npm config set msvs_version 2012 --global'. Questo dovrebbe risolvere l'errore 'binding.gyp'. Indipendentemente da ciò, Bamboo probabilmente non vedrà i file src. Si potrebbe iniziare con l'impostazione HOME o USERPROFILE come variabili di ambiente. –

Problemi correlati