-
-
Notifications
You must be signed in to change notification settings - Fork 940
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
Improvements to pnpm setup
#5000
Comments
I am an I'm not asking for adding support for yet another magical shell here. Different shells may have different ways to set environment variables. And different users may manage their environment variables in different ways. Supporting updating environment variable config for a specific shell is nice to have, but not a must. How about leaving a message describing what environment variables should be updated when an unsupported shell is encountered? Thus users could know what goes on when |
Sounds good. |
same with nushell, getting shell unsupported when running let-env PNPM_HOME = "~/.local/share/pnpm"
let-env PATH = ($env.PATH | append "~/.local/share/pnpm") error when running ERROR The configured global bin directory "~/.local/share/pnpm" is not in PATH
For help, run: pnpm help list |
workaround let-env PNPM_HOME = $"($env.HOME)/Library/pnpm"
let-env PATH = ($env.PATH | append $env.PNPM_HOME) |
this is a helpful workaround and works with the new nushell syntax:
|
This is the first result when searching "pnpm could not infer shell type", and despite being closed does not give any useful information on how to actually resolve the problem.
Pnpm's shell detection depends on one of the environment variables
ZSH_VERSION
,BASH_VERSION
,FISH_VERSION
, orSHELL
being set. None of those shells actually exports their*_VERSION
variables by default, so we can ignore all of that and it comes down toSHELL
.The problem in the original issue is that the
python:3.9.12-bullseye
image uses dash, not bash, zsh, or fish, as its/bin/sh
. So runningcurl -fsSL https://get.pnpm.io/install.sh | sh -
runs in dash, which is not a supported shell for pnpm's detection. If you docurl -fsSL https://get.pnpm.io/install.sh | bash -
instead it'll work after a fashion (it'll install pnpm locally for the container's default user, not to/usr/local
despitePNPM_HOME
being set to that; the best way to actually install pnpm globally seems to still benpm install --global pnpm
as root).I came here instead because I was running
pnpm setup
inside an already-running container (with pnpm installed globally via npm, as above) and it was giving the "could not infer shell type" error even though I was running in bash. In this case the problem is that the non-login environment the container starts up with doesn't exportSHELL
. That can be worked around withexport SHELL
, or by doing likeSHELL=$SHELL pnpm setup
to pass the variable sopnpm setup
can see it. Then either waysource .bashrc
works to pick up the changespnpm setup
made, no need to open a new terminal.Originally posted by @anomiex in #4495 (comment)
The text was updated successfully, but these errors were encountered: