Closed xavdid closed 3 weeks ago
Same as me.
The same issue occurred for me with other backends, at least with cargo
and ubi
.
Also experiencing this with some specific npm libs
From this list https://github.com/bellini666/dotfiles/blob/master/mise/config.toml#L44, I'm experiencing issues with:
I have the same issue. And after looking into it, mise adds to PATH
only the packages you pass as parameters, so if you do mise install npm:xxx npm:yyy
, only the bin path to /mise/path/to/xxx
and /mise/path/to/yyy
will be included, but not /mise/path/to/npm
. So you will see the error if you don't have a system version of npm.
A workaround is to add the mise shims
dir in your PATH
, or do mise install npm npm:xxx npm:yyy
every time (even if you already installed and used npm with mise).
It would be nice to also improve the error message here, as it's misleading that people would interpret the error message as if the path is not found, but it actually says npm is not found!
Looks like this is an issue across all experimental backends? Probable duplicates:
Ok, I had some time for this today.
I think ultimately it comes down to the the ctx.ts.list_paths()
not correctly including the deps (in this case, node
):
https://github.com/jdx/mise/blob/6730416d39a8b95418670d9853e0cc1e4ad5cafc/src/backend/npm.rs#L73
Adding .envs(self.dependency_env()?)
fixes the issue, but given that it affects so many of the experimental backends, there's probably a more central way to do this
Describe the bug
When the active configuration file lists an npm package that isn't installed,
mise install
fails with an error:To Reproduce
mise install
Expected behavior
The
npm
packagetldr
is installed and thetldr
command works.mise doctor
outputAdditional context
I thought this was related to https://github.com/jdx/mise/issues/2154, but I see that was fixed (and released) and I can still reproduce.
Also weirdly, the command that's listed as failing (
npm install -g tldr@3.4.0 --prefix /Users/david/.local/share/mise/installs/npm-tldr/3.4.0
) works if run directly. I've confirmed the/Users/david/.local/share/mise/installs/npm-tldr
directory exists, but is empty.