topgrade-rs / topgrade

Upgrade all the things
GNU General Public License v3.0
1.9k stars 123 forks source link

Cannot disable pnpm #182

Closed diegose closed 1 year ago

diegose commented 1 year ago

What did you expect to happen?

Adding "pnpm" to my disable list should skip pnpm. Running topgrade --only pnpm should run pnpm only.

What actually happened?

error: "pnpm" isn't a valid value for '--only <STEP>...'

Additional Details

error: "pnpm" isn't a valid value for '--only ...'
    [possible values: asdf, atom, brew_cask, brew_formula, bun, bin, cargo, chezmoi, chocolatey, choosenim, composer, conda, config_update, containers, custom_commands, deb_get, distrobox, deno, dotnet, emacs, firmware, flatpak, flutter, fossil, gcloud, gem, ghcup, github_cli_extensions, git_repos, go, guix, haxelib, gnome_shell_extensions, home_manager, jetpack, julia, kakoune, krew, macports, mas, micro, myrepos, nix, node, opam, pacdef, pacstall, pearl, pipx, pip3, pkg, pkgin, powershell, protonup, raco, rcm, remotes, restarts, rtcl, rustup, scoop, sdkman, sheldon, shell, snap, sparkle, spicetify, stack, system, tldr, tlmgr, tmux, toolbx, vagrant, vcpkg, vim, winget, wsl, yadm]

9999years commented 1 year ago

Yeah, I guess we should make pnpm a separate step from node? The way topgrade groups programs together is a little weird. Apparently in the old repo npm/pnpm were briefly disentangled and then put back together again.

I've been thinking about how best to do this; would you mind elaborating a bit on why you want to disable pnpm? Do you use it only in some contexts, are you hitting that bug where pnpm as installed by default errors until you set up some global state for it...?

diegose commented 1 year ago

I don't really use pnpm; it shows an error when doing that step:

 ERROR  The configured global bin directory "/Users/diego/Library/pnpm" is not in PATH

So yeah, the second one 😀

nicks-passiert commented 1 year ago

For me the same, I would like to disable npm and pnpm because I"m only using yarn.

s34m commented 1 year ago

We still have this problem mentioned in #170

I was going to advocate for making pnpm/npm/yarn separate steps and found this somewhat strange issue from the old repo: https://github.com/r-darwish/topgrade/issues/938

Nieto2018 commented 1 year ago

Hi,

I use nvm and to solve it I done the following.

Logs showed that topgrade runs the command "/home//.nvm/versions/node/v19.1.0/bin/pnpm root -g", which fails.

I runned the same command manually to check the error:

$ home/<user_dir>/.nvm/versions/node/v19.1.0/bin/pnpm root -g
 ERROR  Unable to find the global bin directory
Run "pnpm setup" to create it automatically, or set the global-bin-dir setting, or the PNPM_HOME env variable. The global bin directory should be in the PATH.

and next:

$ pnpm setup
Appended new lines to /home/<user_dir>/.zshrc

Next configuration changes were made:
export PNPM_HOME="/home/<user_dir>/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"

To start using pnpm, run:
source /home/<user_dir>/.zshrc

if pnpm setup fails, try with /home/<user_dir>/.nvm/versions/node/v19.1.0/bin/pnpm setup

Take care because your pnpm path could be different.

It works for me, but if the solutions doesn't work you can skip this step with topgrade --disable node -y

raszi commented 1 year ago

I would rather have the option to disable the pnpm upgrade steps in topgrade, instead of forcing me to setup pnpm since I am not using that anywhere.

Morl99 commented 1 year ago

Just wanted to leave a note, that pnpm can now be disabled individually, see https://github.com/topgrade-rs/topgrade/pull/260.