Command failed: unzip -oq -d

Command failed: unzip -oq -d

問題描述

nodejs使用child_process執行解壓操作,Linux生產環境下,一直報錯。
Command failed: unzip -oq -d /root/5ea01d2383e6f8057b829349/materials /root/5ea01d2383e6f8057b829349/materials/material.zip/ unzip: cannot find or open /root/5ea01d2383e6f8057b829349/materials/material.zip/, /root/5ea01d2383e6f8057b829349/materials/material.zip/.zip or /root/5ea01d2383e6f8057b829349/materials/material.zip/.ZIP.

查找本地文件,確實存在/root/5ea01d2383e6f8057b829349/materials/material.zip

問題原因

是因爲目的路徑多加了一個/
細品:
/root/5ea01d2383e6f8057b829349/materials/material.zip
/root/5ea01d2383e6f8057b829349/materials/material.zip/

很sb的一個問題,調試了好久才發現

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章