Skip to content

pnpm: persist global data and add to path #6762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jack-mil
Copy link
Contributor

Following off of the similar python and rustup manifests, I have updated pnpm to make use of the $PNPM_HOME env variable in order to install global packages or cli utilities into a scoop-managed and persisted directory (instead of the default on windows: ~/AppData/Local/pnpm/global

An alternative approach would be to:

a) Leave the pnpm default global directory as is, and simply add ~/AppData/Local/pnpm/global to PATH when installing the manifest. This would also fix issues like #6713. But the application data would not be contained within the ~/scoop folder (generally prefered).

b) Instruct users to run pnpm setup after installation, which will
- create a home directory for the pnpm CLI (~/AppData/Local/pnpm/global)
- adds the pnpm home directory to the PATH environment variable
- copies the pnpm executable to the pnpm home directory
In this case however, scoop will no longer manage pnpm at all, and it will be no different than installing manually (without scoop).

Note: $PNPM_HOME cannot be set to "$persist_dir\pnpm_data" because it seems that pnpm checks at runtime if the exact directory $PNPM_HOME is in $PATH, and doesn't follow symlinks.

Fixes: #6713

  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Copy link
Contributor

All changes look good.

Wait for review from human collaborators.

pnpm

  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

@jack-mil
Copy link
Contributor Author

I realize that this is a pretty major breaking change to those using this manifest already. Migration or at the very least a warning on updating is probably required. I would need advice on what is the canonical way to do that; if this change is even deemed necessary in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: pnpm does not add a global bin directory
1 participant