From 5e8e124b4e15ac75d8cc7c10aabc870abd4d1a31 Mon Sep 17 00:00:00 2001
From: siduck76 <siduckk76@protonmail.com>
Date: Sat, 1 May 2021 12:02:40 +0530
Subject: [PATCH] install npm pkgs globally by local prefix

---
 install.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/install.sh b/install.sh
index 5bd9fc8..a71fa3d 100755
--- a/install.sh
+++ b/install.sh
@@ -16,6 +16,8 @@ for lang in $default_lsp_langs; do
   choose_langs $lang
 done
 
+npm config set prefix=~/.node_modules # for global npm pkg installation
+
 pfx="~~~~~ "
 heading() {
   echo
@@ -83,7 +85,7 @@ install_node_deps() {
     echo "npm not installed"
     return
   fi
-  sudo npm install -g $@
+  npm install -g $@
 }
 
 # install languages
@@ -134,6 +136,8 @@ if [[ ${warn_path} == true ]]; then
   echo "Ensure ${LSP_BIN_PATH} is available in your \$PATH variable"
 fi
 
+echo "add ~/.node_modules/bin at PATH!"
+
 # install all plugins via packer
 
 nvim +PackerInstall