Open hverlin opened 4 days ago
We can fix this, but since node is in your config there isn't any need to also specify it on the command line. If you didn't include it then it would work.
I have noticed that it's not always working as it should if I don't specify the tool.
Let's say I only update mise.toml
file and try to run mise -x
.
Here is what happens:
[tools]
node = "23"
> mise x -c 'node -v'
mise WARN missing: node@23.1.0
zsh:1: command not found: node
However, if I just type node
it works (given that my shell had mise
activated)
> node
mise node@23.1.0 ✓ installed
Welcome to Node.js v23.1.0.
Type ".help" for more information.
>
Oh right, I forgot that is by design. It doesn't auto install if no other versions are installed
For additional context, this is how I was thinking of using this. In GitLab CI, I was thinking I could just do:
build:
stage: build
image: some-image-with-mise
script: |
mise x -c 'pnpm i'
without mise install
It doesn't auto install if no other versions are installed
Ah, makes sense! Do you think it could be added to the warning message?
Do you think it could be added to the warning message?
I think it's too much noise, the fix should be obvious I would think—running mise i
Maybe then, would it be possible to have a flag for mise exec
and mise run
to always run the install
?
mise run --install ...
mise exec --install ...
(since in the code it anyway checks for it, and there is a force
install option in the code)
This would fit nicely with https://mise.jdx.dev/tips-and-tricks.html#shebang
Another thing which surprised me is that postinstall
does not require one to trust the file, whereas env
variables do?
(Happy to contribute to fix this issue, btw)
There is this setting also: https://mise.jdx.dev/configuration/settings.html#not_found_auto_install I think it would need to clarify that it will auto-install only if:
it only autoinstalls if at least 1 version is already installed
mise run --install ...
I don't think it's worth adding a flag for. I would just run mise i && mise x
. shebang trick is a good point but I still don't think it's worth the noise.
Describe the bug
postinstall
step is not run when usingmise exec
.mise install --force <tool>
again ifmise x <tool>
was already run.To Reproduce
Here is the current behavior
Expected behavior Using
mise x node -c 'pnpm -v'
I would expect:mise
to installnode
specified in mymise.toml
filepostinstall
pnpm -v
i.e. same behavior as:
mise version