My node version is showing as 14.x even though my NVM configuration is set to default to 16.x. This is breaking my precommit hooks and making Sublime Merge unusable.
My precommit hook script runs one of the following commands:
> nyc mocha -r sucrase/register -n no-experimental-fetch './test/**/*.js'
But the no-experimental-fetch
flag is not supported for Node 14 binary. So I see this error:
/Users/samholmes/.nvm/versions/node/v14.15.0/bin/node: bad option: --no-experimental-fetch
When I run node -v
from my terminal I see:
❯ node -v
v16.15.1
Which is correct because NVM is set to use v16.15.1 as the default:
❯ nvm ls
v10.23.0
v12.19.0
v14.15.0
v14.17.5
-> v16.15.1
v18.13.0
v19.4.0
system
default -> 16 (-> v16.15.1)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v19.4.0) (default)
stable -> 19.4 (-> v19.4.0) (default)
lts/* -> lts/hydrogen (-> v18.13.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.2 (-> N/A)
lts/gallium -> v16.19.0 (-> N/A)
lts/hydrogen -> v18.13.0
Why is sublime merge not reading my ZSH configuration files properly?
Here is are ZSH files:
.zshenv
echo "loaded .zshenv"
. "$HOME/.cargo/env"
XDG_CONFIG_DIR="$HOME/.config"
export LOADED="$LOADED .zshenv"
export PATH="$HOME/.radicle/bin:$PATH"
export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH"
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# PATH
export PATH="$HOME/bin:$PATH"
# export PATH="$PATH:$(yarn global bin)"
# export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export PATH="/Users/samholmes/.deno/bin:$PATH"
if [[ "$(/usr/bin/arch)" = "arm64" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Android NDK env var for building Edge React GUI
#export ANDROID_NDK_HOME=/Users/samholmes/Library/Android/sdk/ndk-bundle
#export NDK_HOME=/Users/samholmes/Library/Android/sdk/ndk-bundle
#export SDK_HOME=/Users/samholmes/Library/Android/sdk
#export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
# export PATH="ZSHENV:$PATH"
.zshrc
echo "loaded .zshrc"
export LOADED="$LOADED .zshrc"
# Aliases
alias rc="$EDITOR $HOME/.zshrc && source $HOME/.zshrc"
alias rerc=". $HOME/.zshrc"
alias alias l="ls -al"
alias lemmeknow='afplay /System/Library/Sounds/Submarine.aiff'
alias yip="$HOME/yip"
alias yall="yarn && yarn prepare && yarn prepare.ios"
alias yuck="rm -rf node_modules ios/Pods && yarn && yarn prepare && yarn prepare.ios && lemmeknow"
alias indexbundle="(curl 'http://localhost:8101/plugin-bundle.js' || curl 'http://localhost:8081/index.bundle?platform=ios') > /tmp/index.bundle.js && $EDITOR /tmp/index.bundle.js"
alias code="code-insiders"
# alias eslintfmt="eslint --stdin --fix-dry-run --format=json | jq -r '.[0].output'"
# PATH
export PATH="$HOME/bin:$PATH"
export PATH="$PATH:$(yarn global bin)"
# export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export PATH="/Users/samholmes/.deno/bin:$PATH"
if [[ "$(/usr/bin/arch)" = "arm64" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
export EDITOR=$(which hx)
# Kitty SSH Fix
[[ "$TERM" == "xterm-kitty" ]] && alias ssh="kitty +kitten ssh"
# Pure
fpath+=$HOME/.zsh/pure
autoload -U promptinit; promptinit
prompt pure
zstyle :prompt:pure:prompt:success color green
# lf command
LFX="$HOME/.config/lf/lfx.sh"
if [ -f "$LFX" ]; then
source "$LFX"
fi
alias lf="lfx"
# Android NDK env var for building Edge React GUI
#export ANDROID_NDK_HOME=/Users/samholmes/Library/Android/sdk/ndk-bundle
#export NDK_HOME=/Users/samholmes/Library/Android/sdk/ndk-bundle
#export SDK_HOME=/Users/samholmes/Library/Android/sdk
#export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
# Termbin
alias tb="nc termbin.com 9999"
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
####################
# Custom Functions #
####################
source $HOME/.functions.sh
source /Users/samholmes/.config/broot/launcher/bash/br
function za() {
if [[ -z $(zellij list-sessions | grep main) ]]; then
zellij --session main
else
zellij attach main
fi
# if [[ $? == '0' ]]; then
# exit
# fi
# zellij options --simplified-ui true
}
# if [[ $TERM_APP == 'alacritty' && -z "${ZELLIJ}" ]]; then
# zel();
# fi
export PATH="$PATH:/Users/samholmes/.foundry/bin"
export PATH=$PATH:$HOME/.maestro/bin
# export PATH="ZSHRC:$PATH"
.zprofile
#eval "$(/opt/homebrew/bin/brew shellenv)"
echo "loaded .zprofile"
export LOADED="$LOADED .zprofile"
[ -f ~/.config/LF_ICONS ] && {
LF_ICONS="$(tr '\n' ':' <~/.config/LF_ICONS)" \
&& export LF_ICONS
}
You can probably tell I’ve added some echo statements for debugging purposes (none of which show up in the Sublime Merge output). You probably notice a bit of duplication within my files which is also from debugging this problem.
Please someone help me figure out how to make Sublime Merge work again.