系统终端which pnpm路径是
/Users/zhanglinfeng/.nvm/versions/node/v16.19.1/bin/pnpm
vscode终端 which pnpm 路径是
/usr/local/bin/pnpm
为了跟系统的一致,需要修改.zshrc文件
新的
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. export PATH="$PATH:$HOME/.rvm/bin" # nvm config export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node # pnpm export PNPM_HOME="/Users/zhanglinfeng/.nvm/versions/node/v16.19.1/bin/pnpm" export PATH="$PNPM_HOME:$PATH" # pnpm endexport HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
旧的是
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. export PATH="$PATH:$HOME/.rvm/bin" # nvm config export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node # pnpm export PNPM_HOME="/Users/zhanglinfeng/Library/pnpm" export PATH="$PNPM_HOME:$PATH" # pnpm endexport HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
然后source ~/.zshrc,然后重启vscode
标签:vscode,export,终端,pnpm,PATH,nvm,HOME,NVM From: https://www.cnblogs.com/zhanglinfeng/p/18454825