Snap of npm always selected before local package

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
$ echo $PATH
$ which npm

I would like ~/.npm-global/bin/npm to be my default npm but I’m not sure how to make this happen :confused:

Have you tried preparing the desired location to $PATH? Setting this in your shell profile PATH=$HOME/.npm-global/bin:$PATH should be enough.

Yes, if you check my (admittedly long) $PATH, I have ~/.npm-global/bin way before /snap/bin.

May it be that ~ is not getting expanded?

Indeed that was the issue, my bad :sweat_smile: Thanks a lot :blush: