lukechilds / zsh-nvm

Zsh plugin for installing, updating and loading nvm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a lazy loader function for yarn if it's been installed via brew

lukechilds opened this issue · comments

As discussed in #15 (comment)

I have the same problem currently. I installed yarn via the installer and not via brew. And it would be nice if it would be lazy loaded.

If I do type yarn I see yarn is /Users/username/.yarn/bin/yarn.

Anyway to figure out why it doesn't work?
Okay figured it out, $PATH has to be adjusted before initializing antigen.

Also I have other usecases for binaries that should init nvm. Maybe it would be nice to be able to specify commands that should be wrapped.

@danez Adding something like:

export NVM_LAZY_LOADERS="foo bar baz"

should be fairly straight forward.

Can you explain your other use cases? Are you running scripts with #!/usr/bin/env node that aren't global modules?

Exactly. For exmaple when I try to run eslint directly from the node_modules folder it prints a warning:

❯ node_modules/.bin/eslint src/
env: node: No such file or directory

node node_modules/.bin/eslint src/ should work.