Skip to content
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

Documentation foot gun #147

Open
jasonkuhrt opened this issue Nov 11, 2024 · 0 comments
Open

Documentation foot gun #147

jasonkuhrt opened this issue Nov 11, 2024 · 0 comments

Comments

@jasonkuhrt
Copy link

If user wants to use pnpm env ... then the current documentation leads them astray because it yields this $PATH:

/opt/hostedtoolcache/node/22.10.0/x64/bin:/home/runner/setup-pnpm/node_modules/.bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Note that hostedtoolcache precedes the pnpm bin. This means that when pnpm env is used it will not override the static bin in hostedtoolcache.

One way to fix this is change the order contrary to the docs of steps, such that node is setup BEFORE pnpm. But that only works if cache: pnpm is NOT used. 🐔 🥚

It also does not work to run pnpm setup after because it will see that pnpm is in the path (just not before hostedtoolcache) and thus do nothing:

Appended new lines to /home/runner/.bashrc

Next configuration changes were made:
export PNPM_HOME="/home/runner/setup-pnpm/node_modules/.bin"
case ":$PATH:" in
  *":$PNPM_HOME:"*) ;;
  *) export PATH="$PNPM_HOME:$PATH" ;;
esac

Are are solutions that permit pnpm env working AND node setup using cache: pnpm? If so, let's document them. If not, let's mention this caveat.

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

No branches or pull requests

1 participant