Set Node prefix & cache to local directory on Linux.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 02 Jun 2021 03:54:39 +0300
changeset 982 087e216676be
parent 981 79ac660917cb
child 983 710597383618
Set Node prefix & cache to local directory on Linux.
.env.bash
.npmrc
--- a/.env.bash	Tue Jun 01 17:58:43 2021 +0300
+++ b/.env.bash	Wed Jun 02 03:54:39 2021 +0300
@@ -79,8 +79,8 @@
 # GRADLE_OPTS="$GRADLE_OPTS -Djava.io.tmpdir=c:/tmp"
 export GRADLE_OPTS
 
-if [[ ! :$PATH: =~ :$HOME/.npm-packages/bin: ]]; then
-  export PATH=$PATH:$HOME/.npm-packages/bin
+if [[ :$PATH: != *:$HOME/.local/npm:* && $OSTYPE != cygwin ]]; then
+  export PATH=$PATH:$HOME/.local/npm
 fi
 
 export RLWRAP_HOME=$HOME/.rlwrap
--- a/.npmrc	Tue Jun 01 17:58:43 2021 +0300
+++ b/.npmrc	Wed Jun 02 03:54:39 2021 +0300
@@ -1,1 +1,4 @@
-prefix = ${HOME}/.npm-packages
+# npm config get prefix
+prefix = ${HOME}/.local/npm
+# npm config get cache
+cache = ${HOME}/.cache/npm