aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--_npmrc8
-rw-r--r--_profile4
2 files changed, 8 insertions, 4 deletions
diff --git a/_npmrc b/_npmrc
index f9e0a43..f65e5f4 100644
--- a/_npmrc
+++ b/_npmrc
@@ -1,7 +1,7 @@
;;
-;; npm config
+;; NPM user config
;;
-;; install packages under user home directory
-prefix = ${HOME}/npm
-
+;; Install packages under user home directory (without sudo)
+;; Credit: https://github.com/glenpike/npm-g_nosudo
+prefix = ${HOME}/.npm-packages
diff --git a/_profile b/_profile
index 7390d9c..0c9102d 100644
--- a/_profile
+++ b/_profile
@@ -30,6 +30,10 @@ _path_append() {
PATH="${PATH}:$1"
}
+# local installed npm packages (see also `~/.npmrc`)
+if [ -d "$HOME/.npm-packages/bin" ]; then
+ _path_prepend "${HOME}/.npm-packages/bin"
+fi
# local installed packages (e.g., python)
if [ -d "$HOME/.local/bin" ]; then
_path_prepend "${HOME}/.local/bin"