Describe the bug
After the update, an .envrc fil gets reloaded I see this message at the end & node doesn't get updated properly.
/bin/bash:708: $1: unbound variable
To Reproduce
Steps to reproduce the behavior:
Create an .envrc file like this & try to load it.
set -e
watch_file .nvmrc
use node # if I comment this out, everything works fine.
layout node
Expected behavior
To not show this message
Environment
Additional context
This is what I have in my .zshrc file for Direnv + node setup.
export N_PREFIX="${HOME}/.n"
export NODE_VERSIONS="${N_PREFIX}/n/versions/node"
export NODE_VERSION_PREFIX=""
(( $+commands[direnv] )) && eval "$(direnv hook zsh)"
and here is the ls output of this directory ${N_PREFIX}/n/versions/node
total 0
drwxr-xr-x 8 ahmed staff 256 Dec 14 12:52 .
drwxr-xr-x 3 ahmed staff 96 Aug 24 21:30 ..
drwxr-xr-x 9 ahmed staff 288 Nov 15 14:23 10.15.1
drwxr-xr-x 9 ahmed staff 288 Aug 24 21:30 10.16.0
drwxr-xr-x 9 ahmed staff 288 Oct 2 10:04 10.16.3
drwxr-xr-x 9 ahmed staff 288 Aug 28 20:45 11.15.0
drwxr-xr-x 9 ahmed staff 288 Nov 2 14:04 12.13.0
drwxr-xr-x 10 ahmed staff 320 Dec 14 12:53 9.11.2
and I'm using https://github.com/tj/n for node versions
thanks for the report. Fixed in #564
Thanks @zimbatm but I'm now getting this with 2.21.1 I'm installing direnv using homebrew
/bin/bash:335: !1: unbound variable
is it still caused by the call to use node?
yes
thanks. in the meantime, add set +u at the top of the .envrc
Most helpful comment
thanks. in the meantime, add
set +uat the top of the.envrc