Skip to content

Commit 7a82d1e

Browse files
committed
1 parent 63b1e84 commit 7a82d1e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

setup.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,13 @@ function install_vim_plugins()
7878
mkdir -p "${HOME}/.local/share/coc/"
7979
cd ~/.local/share/coc/extensions
8080
if command -v npm > /dev/null && [ "$(whoami)" != root ]; then
81-
npm install --global-style --ignore-scripts --no-bin-links --no-package-lock --only=prod --omit=dev
81+
npm_major_version="$(npm --version | awk -F. '{print $1}')"
82+
if [ "${npm_major_version}" -ge 9 ]; then
83+
opt=--install-strategy=shallow
84+
else
85+
opt=--global-style
86+
fi
87+
npm install "${opt}" --ignore-scripts --no-bin-links --no-package-lock --omit=dev
8288
else
8389
vim -c "CocDisable" -c quit -c quit
8490
fi

0 commit comments

Comments
 (0)