Skip to content

Commit ff6463f

Browse files
committed
🐛 fix: fixed npm global packages installation
1 parent ead947f commit ff6463f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Setup.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,17 @@ function Setup {
587587
elseif (Get-Command npm -ErrorAction SilentlyContinue) {
588588
Write-PrettyTitle "Install NPM Global Packages"
589589
foreach ($package in $npmPackages) {
590-
npm install --global --silent $package
591-
Write-PrettyOutput -p "npm" -e "$package" -m "installed."
590+
$cmd = $package.Command
591+
$packages = $package.Packages
592+
if (!(Get-Command $cmd -ErrorAction SilentlyContinue)) {
593+
foreach ($pkg in $packages) {
594+
npm install --global --silent $pkg
595+
Write-PrettyOutput -p "npm" -e "$pkg" -m "installed."
596+
}
597+
}
598+
else {
599+
Write-PrettyOutput -p "npm" -e "$cmd" -m "already installed."
600+
}
592601
}
593602
}
594603

0 commit comments

Comments
 (0)