-
-
Notifications
You must be signed in to change notification settings - Fork 936
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
feat(config): support custom global bin dir #3762
Conversation
Read /usr/local/etc/pnpmrc to support the platform-specific global bin dir.
This change is for Homebrew/homebrew-core@4546e4c. |
pnpm uses npm's config system and we already read the global npmrc file. Can't we just reuse that? |
Read /usr/local/etc/npmrc
@zkochan I removed pnpmrc and this PR is just adding the |
|
some tests should be added. |
I'm struggling to create tests😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a changeset for your change
Run pnpm changeset
Yes, tomorrow. I have to wait for CI. |
slash and backslash problem. |
Investigating |
This reverts commit 4feafac.
|
Oh thanks for the changeset. I couldn't wait for CI and fell asleep. |
With this config, pnpm will install global package's executables into ~/Library/pnpm (macOS) or ~/.local/pnpm (Linux) by default. This config allows pnpm to provide the command `pnpm env use --global 16` safely with Homebrew. Refer to pnpm/pnpm#3762.
Abstract
It would be great that the package manager can customize the global bin directory along with its policy.
I propose
global-bin-dir
in a npmrc to customize the global bin directory of pnpm.Use case
Homebrew/homebrew-core#82892
In Homebrew, create
/usr/local/etc/npmrc
and addglobal-bin-dir = ${HOME}/Library/pnpm
to it.It will change the global bin directory to
~/Library/pnpm
without PNPM_HOME set.(In Linuxbrew,
~/.local/pnpm
would be used)References
#3713