TFS 構建中的 npm install 拋出“未找到:git” (npm install in TFS build throws "not found: git")


問題描述

TFS 構建中的 npm install 拋出“未找到:git” (npm install in TFS build throws "not found: git")

我為 windows 和 node.js 安裝了 Git,它們都在系統的變量“Path”上並且可用。

在此處輸入圖片描述

我在項目中有 packages.json 文件,並且有 TFS 構建步驟定義可以這樣調用它:

<Target Name="BeforeBuild">
  <Exec Command="npm install" /> 
</Target>

當我轉到 TFS 服務器並在我的項目目錄中執行“npm install”時,所有包設置正確。

當 TFS 在構建過程中執行“npm install”時,我收到此錯誤: EXEC (0, 0) not found: git

在此處輸入圖片描述


參考解法

方法 1:

Ran into the same issue with Bamboo. TFS is running as a service and the service account's PATH may be different than what you're seeing here. If you can , log in to the TFS user's account and adjust the "User Variables" to include you path to Git. The application is likely taking the "user path variable" instead of combining the "user" and "system" paths.

system vars

(by Denisdevduderino)

參考文件

  1. npm install in TFS build throws "not found: git" (CC BY‑SA 2.5/3.0/4.0)

#npm #tfs #node.js #npm-install






相關問題

TFS 構建中的 npm install 拋出“未找到:git” (npm install in TFS build throws "not found: git")

找不到模塊“電子” (Cannot find module 'electron')

使用 npm 進行生成器角度安裝時出現問題 (Trouble during generator-angular installation with npm)

使用 node.js 從谷歌云存儲中刪除多個對象 (Delete multiple objects fron google cloud storage using node.js)

VS Task Runner Explorer - Node Sass 找不到綁定 (VS Task Runner Explorer - Node Sass could not find a binding)

有什麼東西可以跟踪我安裝的 npm 包並在不同的開發環境中恢復它們嗎?(如“恢復 NuGet 包”) (Is there anything that can keep track of my installed npm packages and restore them on a different dev environment ? (like "Restore NuGet packages"))

角度材質工具欄不繼承自角度材質 (Angular material toolbar not inheriting from angular materials)

npm install throws 和錯誤告訴 node 不是一個可識別的命令 (npm install throws and error telling node is not a recognized command)

從代理後面登錄的無服務器框架? (Serverless Framework Login From Behind a Proxy?)

構建工具結構 - NPM、Grunt 和 Wordpress (Build tools structure - NPM, Grunt with Wordpress)

如何解決 Linux 中的“npm ERR!code ELIFECYCLE”錯誤? (How to solve "npm ERR! code ELIFECYCLE" error in Linux?)

如何在 Angular 中導入“數字”:“^1.2.6”? (How to import "numeric": "^1.2.6" in Angular?)







留言討論