簡體   English   中英

Jenkins npm build無法在Windows從站上解壓縮軟件包

[英]Jenkins npm build fails to unzip a package on Windows slave

我在我的package.json中添加了一個Windows從站來進行npm構建,我執行了一個執行“ unzip pack.zip”的步驟。

當我直接在盒子上建立npm時,它可以成功完成所有操作,但是當使用Jenkins作業完成時,它無法解壓縮文件,即pack.zip

甚至可以使用Unzip,Winrar和7z等工具正確提取文件。

我寫了bat文件來進行npm構建。 當我使用cmd運行它時,它沒有任何問題,但是當我從詹金斯執行相同的bat文件時,它在相同的提取步驟中失敗了。

在下面添加了日志:

  inflating: saui-client/node_modules/sig-quote/node_modules/sig-core/node_modules/underscore/underscore-min.map  
error:  expected central file header signature not found (file #73741).
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)
  inflating: saui-client/node_modules/sig-quote/node_modules/sig-core/node_modules/underscore/underscore.js  
D:\jenkins\workspace\BUILD>exit 3 
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

沒有日志的唯一想到的事情是,您將奴隸環境連接到Jenkins之后進行了設置-甚至在連接它之后甚至安裝了NodeJS-意味着您計算機上的會話與連接Jenkins時加載的會話不同對此。 一種簡單的解決方案是斷開從屬服務器,然后將其與新環境重新連接,以便會話將具有運行所需的一切。 當您有日志時,我將更新我的答案。

祝好運!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM