Home > Enterprise >  Global packages run fine but getting Command Not Found for locally installed packages
Global packages run fine but getting Command Not Found for locally installed packages

Time:01-21

I just got a new M1 Mac, installed node with home-brew and am seeing globally installed packages working just fine but getting "zsh: command not found: (packagename)"for locally installed packages.

here's what my .zshrc file looks like

eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH="$PATH:/usr/local/share/npm/bin"
export PATH="$HOME/.npm-packages/bin:$PATH"
export PATH="$HOME/.node/bin:$PATH"
export PATH="~/node_modules/:$PATH"

CodePudding user response:

export PATH="~/node_modules/:$PATH"

should be

export PATH="$HOME/node_modules/:$PATH"

or

path =(~/node_modules)

AFIK, bash can do tilde-expansion in the PATH string, but zsh can't.

  •  Tags:  
  • Related