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
I recently started to use pnpm and found that when I use pnpm any-command, the pnpm autocompletion are working for pnpm instead of that command. Also, I don't think that everybody every time will add pnpm or even p alias to every command he writes which can lead to bugs because of node version.
I was wondering if is it possible to have something similar like nvm auto using the required node version when you cd into a project:
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"local nvmrc_path="$(nvm_find_nvmrc)"if [ -n"$nvmrc_path" ];thenlocal nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")if [ "$nvmrc_node_version"="N/A" ];then
nvm install
elif [ "$nvmrc_node_version"!="$node_version" ];then
nvm use --silent
fielif [ "$node_version"!="$(nvm version default)" ];then
nvm use default --silent
fi
}
But this script works only for linux/mac. Did anybody find an approach to use pnpm across the team?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I recently started to use pnpm and found that when I use
pnpm any-command
, the pnpm autocompletion are working for pnpm instead of that command. Also, I don't think that everybody every time will add pnpm or even p alias to every command he writes which can lead to bugs because of node version.I was wondering if is it possible to have something similar like nvm auto using the required node version when you cd into a project:
But this script works only for linux/mac. Did anybody find an approach to use pnpm across the team?
Beta Was this translation helpful? Give feedback.
All reactions