2016-10-11 58 views
1

我們正在使用Visual Studio Team Services來構建和部署多個站點。有些.NET,有些則不是。使用託管代理時,所有工作正常。由於託管代理的性能問題和長隊列時間,我們需要使用我們自己的構建代理。 這裏談到的問題: 當運行VSTS建立運行涼亭,當我們得到一個錯誤:VSTS鮑爾找不到

****************************************************************************** 
Starting: bower install 
****************************************************************************** 
C:\Program Files (x86)\nodejs\npm.cmd install -g bower 
C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\bower -> C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\node_modules\bower\bin\bower 
[email protected] C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\npm\node_modules\bower 
Not found bower: null 
****************************************************************************** 
Finishing: bower install 
****************************************************************************** 

的問題是,涼亭實際上是在該位置:

npm directory

這裏是實際的涼亭建設步驟:

vsts bower build step

我們該如何解決這個Not found bower: null錯誤?

回答

2

安裝到配置文件文件夾中的工具存在已知問題,它必須使用權限。使用-g參數從管理控制檯安裝該工具更容易。並確保將中央NPM版本添加到服務或系統的%path%環境變量中。

或者在npm:npm install --prefix "$(Agent.WorkFolder)" Bower的調用中添加其他參數以傳入特定位置。然後在Bower任務的高級部分中指定相同的位置。

鮑爾CLI位置:$(Agent.WorkFolder)\node_modules\

(你需要檢查包安裝,我稍微目前猜測的準確位置;))。

+0

感謝您的回答! 我嘗試使用-g參數從管理命令提示符進行安裝,但仍安裝到當前用戶的AppData文件夾中: C:\ Program Files \ nodejs> npm install -g bower C:\ Users \ * username * \ AppData \ Roaming \ npm \ bower - > C:\ Users \ * username \ \ AppData \ Roaming \ n pm \ node_modules \ bower \ bin \ bower [email protected] C:\ Users \ * username * \ AppData \ Roaming \ npm \ node_modules \ bower –

+0

它總是讓我驚訝節點是如何決定把東西放在某個地方的。你確定你是以本地管理員身份運行嗎? – jessehouwing

+0

是的,100%肯定。我三重檢查。 好消息是,我通過在Bower CLI位置中指定更多特定於本地bower lib: '$(Build.SourcesDirectory)\ node_modules \ bower \ bin \ bower'來獲得它的工作。 現在它是吞嚥失敗的一步。 Gulp被發現,但是即使你的gulp依賴被安裝在gulp \ node_modules node.js中,它也找不到其中的一個模塊。 –