nvm
nvm copied to clipboard
use --silent not silent (enough)
Operating system and version:
macOS 15.3.1
nvm debug output:
nvm --version: v0.39.1
nvm ls output:
iojs-v2.5.0
v12.22.12
v14.19.0
v16.13.2
v16.14.2
v16.15.0
v17.4.0
v18.12.1
v18.16.1
v20.9.0
v20.10.0
v21.5.0
v22.6.0
-> v22.11.0
v22.12.0
v22.13.0
v22.13.1
default -> 22.11.0 (-> v22.11.0)
How did you install nvm?
brew install nvm
What steps did you perform?
- ran
nvm use --silentfrom a dir without a.nvmrcfile.
What happened?
It outputted
Please see `nvm --help` or https://github.com/nvm-sh/nvm#nvmrc for more information.
What did you expect to happen?
It to output nothing (to be silent)
Is there anything in any of your profile files that modifies the PATH?
Yes not sure how that applies.
Do note that nvm is unsupported when installed via brew, as the formula informs you.
--silent isn't to suppress all output - you can do that yourself with 2>&1 >/dev/null - it's just to suppress non-error output.
Got it, I fixed my use case (initialising nvm in a new session) by adding
if [ -f ".nvmrc" ]; then
nvm use
fi
to my .zshrc, some flag to achieve the same might be nice to have.
usually one initializes nvm in a new session from the lines the install script puts in - it auto-uses. I suspect if you use the official install script, and not homebrew, you’ll have a better experience.