[Bug] Envman doesn't work i.e. isn't evaluated and updating PATH
stephenjfox opened this issue · 1 comments
What were you trying to install (or what else went wrong)?
webi
, node
, and others
What exactly did you do?
Ran the usual command (I'll use the node example) and got successful output
curl -sS https://webi.sh/node | sh
Full output:
~/dev/scratch_space ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── base Py 10:57:03 ─╮
❯ curl -sS https://webi.sh/node | sh ─╯
>>> Welcome to Webi! - modern tools, instant installs. <<<
We expect your experience to be absolutely perfect!
Success? Star it! https://github.com/webinstall/webi-installers
Problem? Report it: https://github.com/webinstall/webi-installers/issues
(your system is Darwin/x86_64 with libc & curl)
Bootstrapping Webi
Downloading https://webi.sh/packages/webi/webi.sh
to ~/.local/bin/webi
Running ~/.local/bin/webi node@stable
Installing node ...
Found ~/.local/bin
Downloading node from
https://nodejs.org/download/release/v20.11.1/node-v20.11.1-darwin-x64.tar.xz
Saved as ~/Downloads/webi/node/20.11.1/node-v20.11.1-darwin-x64.tar.xz
Extracting ~/Downloads/webi/node/20.11.1/node-v20.11.1-darwin-x64.tar.xz
Installing to ~/.local/opt/node-v20.11.1/bin/node
Installed node and npm at ~/.local/opt/node/
Edit ~/.config/envman/PATH.env to add:
~/.local/opt/node/bin
>>> ACTION REQUIRED <<<
Copy, paste & run the following command:
source ~/.config/envman/PATH.env
(newly opened terminal windows will update automatically)
I ran the provided source ~/.config/envman/PATH.env
. Then ran node --version
getting
~/dev/scratch_space ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 11s base Py 10:57:14 ─╮
❯ source ~/.config/envman/PATH.env ─╯
~/dev/scratch_space ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── base Py 11:04:49 ─╮
❯ node --version ─╯
v20.11.1
I opened the new terminal and found that node
was not on my path.
What went wrong?
Envman (or replacing tools) did not evaluate the load.sh
.
ENVMAN_LOAD='loaded'
gets set, but the test -z
block (within ~/.config/envman/load.sh
) fails.
(replacing the source
invocation with cat
to show that there's no output, as the colors don't carry over and I don't want to upload a screenshot)
~ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── base Py 11:40:07 ─╮
❯ test -z "${ENVMAN_LOAD:-}" ─╯
~ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── base Py 11:45:47 ─╮
❯ test -z "${ENVMAN_LOAD:-}" && cat ~/.config/envman/ENV.env ─╯
~ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── base Py 11:46:03 ─╮
❯ test -z "${ENVMAN_LOAD:-}" && cat ~/.config/envman/PATH.env ─╯
Other notes
I've updated the ENVMAN=1
line in my .zshrc
file to be an export, just in case it was a scope issue (say) with zsh.
export ENVMAN_LOAD=1 # line I changed, to include the `export`
# Generated for envman. Do not edit.
[ -s "$HOME/.config/envman/load.sh" ] && source "$HOME/.config/envman/load.sh"
Which OS did you try on?
- Mac
- Windows
- Linux
What type of computer (i.e. laptop, desktop, Raspberry Pi)?
- Laptop or Desktop (amd64 / x86-64)
- Raspberry Pi (ARM-64)
- Other (please specify, if you know)
The ENVMAN_LOAD
variable should be unset when load.sh
is run, not before. It's there so that sourced multiple times. You should remove the line you added to export the variable. You might even change it to unset ENVMAN_LOAD
to verify that something else wasn't setting it before, causing your problem. I'd also check that ~/.config/envman/PATH.env
still has something in it. Failing that, you'll probably have to debug the hard way by doing something like:
(
echo $ZSH_VERSION
builtin which zsh
unset ENVMAN_LOAD
zsh -lxvic exit
) 2>&1 | tee zsh_startup.log
``
It might be pretty long so it bumps the output in `zsh_startup.log`.
You can read through that to look for your problem or uploading the output somewhere and point to it here so you can get more help.