mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-27 11:04:44 +00:00
Improve npm cache cleanup fallback logic
Adds a fallback to manually remove the npm cache directory if 'npm cache clean --force' fails during cleanup. This ensures the cache is cleared even if the npm command encounters an error.
This commit is contained in:
+4
-1
@@ -818,7 +818,10 @@ cleanup_lxc() {
|
|||||||
# Node.js npm
|
# Node.js npm
|
||||||
if command -v npm &>/dev/null; then
|
if command -v npm &>/dev/null; then
|
||||||
$STD npm cache verify 2>/dev/null || true
|
$STD npm cache verify 2>/dev/null || true
|
||||||
$STD npm cache clean --force 2>/dev/null || true
|
# Clean cache with fallback to manual removal if command fails
|
||||||
|
if ! $STD npm cache clean --force 2>/dev/null; then
|
||||||
|
rm -rf /root/.npm/_cacache 2>/dev/null || true
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# Node.js yarn
|
# Node.js yarn
|
||||||
if command -v yarn &>/dev/null; then $STD yarn cache clean || true; fi
|
if command -v yarn &>/dev/null; then $STD yarn cache clean || true; fi
|
||||||
|
|||||||
Reference in New Issue
Block a user