3 ms·
~/.zshrc:L1:"zmodload zsh/zprof" ~/.zshrc:EOF:"zprof" Doesn't take long to track down the culprits. nvm is a huge contributor to startup lag, IME. I am not a
by sgarland 5y ago
~/.zshrc:L1:"zmodload zsh/zprof"
~/.zshrc:EOF:"zprof"
Doesn't take long to track down the culprits. nvm is a huge contributor to startup lag, IME. I am not a frontend dev, and rarely have to touch Node, so I comment out anything nvm-related for daily work.
- eyelidlessness 5y agoFor folks who use nvm and find it slow, try out Volta[1]. It’s much faster, and IMO a lot nicer to use in general. 1: https://volta.sh/ https://volta.sh/
- rustyminnow 5y agoNvm startup times are the worst. I use it to install npm versions, but then manually add those to my $PATH. There's a --no-use flag that short-circuits all the heavy startup processing, but still gives you access to the command. Here's a snippet from my zshrc: ``` export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --no-use export PATH="$HOME/.nvm/versions/node/v14.17.6/bin:$PATH" ```
- krinchan 5y agoI just use nodenv via anyenv. All the ${X}vm utilities have massive startup lag for some reason.
- nerdponx 5y agoYet another NVM alternative is FNM, which is very fast. I'm surprised there are so many others!
- chrisweekly 5y agoI agree nvm is suboptimal. I've been doing web-related things for a living since 1998 and I care about tooling. YMMV but I have a strong preference for managing node versions via `n` (installed via tiny util `n-install`). My Node-related macOS terminal setup: - iTerm.app - zsh (via brew) - n-install -> n -> node (/npm) - yarn (via npm i -g) - pnpm ("") HTH! :)