I’m developing apps using npm. The node snap, which I’m using, already provides also npm and yarn.
Unfortunately using npm though the snap creates a number of issues, most of which got fixed by setting npm’s default dir to my home folder (Option 2).
However, the snapped npm still takes precedence over the locally installed one.
$ ~/.npm-global/bin/npm --version
7.7.5
$ echo $PATH
/home/fabio/gems/bin:/home/fabio/.pyenv/plugins/pyenv-virtualenv/shims:/home/fabio/.pyenv/shims:/home/fabio/.pyenv/bin:/home/fabio/.yarn/bin:~/.npm-global/bin:/home/fabio/.cargo/bin:/home/fabio/.local/bin:/home/fabio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$ which npm
/snap/bin/npm
I would like ~/.npm-global/bin/npm
to be my default npm
but I’m not sure how to make this happen