Skip to content

Commit 543e19f

Browse files
committed
Do force update of npm
Do a force update of npm when it is outdated. Addresses issue - npm/cli#611
1 parent c873748 commit 543e19f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Node/npm_update.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ if [ -x "$(command -v npm)" ]; then
1414
pver="$(cut -d@ -f2 <<<"$npkg")"
1515
pkg="$(cut -d@ -f1 <<<"$npkg")"
1616
echo "Updating $pkg ($cver-->$pver)"
17-
npm install --global --no-progress --quiet $npkg 1>/dev/null
17+
if [[ $npkg =~ "npm" ]]; then
18+
npm install --force --global --no-progress --quiet \
19+
$npkg 1>/dev/null
20+
else
21+
npm install --global --no-progress --quiet $npkg 1>/dev/null
22+
fi
1823
done
1924
else
2025
echo "No packages to update"

0 commit comments

Comments
 (0)