spent a lot of time today trying to solve a problem with global installs from my node package manager.
I would try something like
npm install -g npm
And see no changes reflected in my npm version number. Or
npm install -g firebase-tools
And see bash: command not found in my terminal after immediately attempting
firebase
I spent hours tinkering with my $PATH, deleting and reinstalling node with brew, and eventually came upon my answer in this post from Trevor Burnham.
Now that my path prefix is /usr/local , globally installed packages are working properly. Though I am not entirely sure why... Before my path prefix was empty and I was still able to work with global npm packages. I understand that brew is installing to the /usr/local directory, but for example, why do we not include /bin/?
Finding this solution my path was mired with small posts like this one suggesting to chmod 777 the usr/local directory and it struck me that a lot of people have struggled on this with spotty guidance.
Hoping some kind, seasoned soul will help me figure out how to logically determine the proper directory for
npm config set prefix ...
/ how to identify these kinds of problems quicker maybe, or what other factors are involved, say, whether or not we used brew to install node and how that effects the global path?
Thanks for any clarity you can offer!