You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_zsh_nvm_auto_use will return early if nvm_find_nvmrc is not found, which will be the case when lazy loading.
Would you consider including a copy of nvm_find_nvmrc inside your code if lazy loading, so that auto use can work as intended, before nvm, node, etc are run for the first time?
The text was updated successfully, but these errors were encountered:
I was having the same issue, and I thought I would share my workaround in case someone might find it useful.
Basically, I declare a directory where, if I open a shell in it or it's sub-dirs, nvm is loaded.
# <-------- .zshrc --------># <------- export zsh-nvm variables **above** -----> # Declare the directory(s) where you codeexport NVM_LAZY_AUTO_DIR=("$HOME/code")
activate_nvm() {
# checking dir in path, and if node is a shell function (not loaded)if [[ $PWD=~$NVM_LAZY_AUTO_DIR&&"$(type node)"=*'a shell function'* ]];then
print 'Activating nvm...'# trigger loading
node --version
# cd into same dir to activate auto_usecd$PWDfi
}
# use this function if LAZY_LOAD is trueif [[ ( $NVM_LAZY_LOAD ) ]];then
precmd_functions+=(activate_nvm)
fi# <-------- source zsh-nvm **below** --------->
_zsh_nvm_auto_use
will return early ifnvm_find_nvmrc
is not found, which will be the case when lazy loading.Would you consider including a copy of
nvm_find_nvmrc
inside your code if lazy loading, so that auto use can work as intended, beforenvm
,node
, etc are run for the first time?The text was updated successfully, but these errors were encountered: