Skip to content

Commit

Permalink
Do force update of npm
Browse files Browse the repository at this point in the history
Do a force update of npm when it is outdated. Addresses issue -npm/cli#611
  • Loading branch information
dkav committed Jan 29, 2020
1 parent c873748 commit 7529e6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Node/npm_update.sh
Expand Up @@ -14,7 +14,12 @@ if [ -x "$(command -v npm)" ]; then
pver="$(cut -d@ -f2 <<<"$npkg")"
pkg="$(cut -d@ -f1 <<<"$npkg")"
echo "Updating $pkg ($cver-->$pver)"
npm install --global --no-progress --quiet $npkg 1>/dev/null
if [[ $npkg =~ "npm" ]]; then
npm install --force --global --no-progress --quiet \
$npkg 1>/dev/null
else
npm install --global --no-progress --quiet $npkg 1>/dev/null
fi
done
else
echo "No packages to update"
Expand Down

0 comments on commit 7529e6c

Please sign in to comment.