-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
install-photobooth: install npm 9.6.7 if needed (#531)
* install-photobooth: install npm 9.6.7 if needed * install-photobooth: run apt-update before updating npm * install-photobooth: purge npm aside nodejs if needed
- Loading branch information
Showing
1 changed file
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -350,6 +350,11 @@ update_nodejs() { | |
apt-get -qq purge -y libnode72 | ||
fi | ||
|
||
if [ $(dpkg-query -W -f='${Status}' "npm" 2>/dev/null | grep -c "ok installed") -eq 1 ]; then | ||
info "[Cleanup] Removing npm package" | ||
apt-get -qq purge -y npm | ||
fi | ||
|
||
info "[Package] Installing latest Node.js v18" | ||
apt-get -qq install -y ca-certificates curl gnupg | ||
mkdir -p /etc/apt/keyrings | ||
|
@@ -381,7 +386,8 @@ proof_npm() { | |
exit 1 | ||
else | ||
warn "[WARN] npm needs to be updated!" | ||
npm install npm@latest -g | ||
apt-get -qq --only-upgrade install npm | ||
npm install [email protected] -g | ||
NPM_CHECKED=true | ||
check_npm | ||
fi | ||
|
@@ -393,6 +399,7 @@ check_npm() { | |
info "[Info] npm available.". | ||
else | ||
info "[Info] npm not installed. Trying to install...". | ||
apt-get -qq update | ||
apt-get -qq install -y npm | ||
fi | ||
proof_npm | ||
|