I don't install packages globally. Usually each package I install belongs to a project. So I install it locally as a dependency. If a package offers CLI functionality I add it in package.json under scripts section.
{
...,
"scripts": {
"webpack": "webpack",
"start": "node .",
...
},
...,
}
Now I can run its CLI features. npm run webpack. If needed I add bash or zsh aliases to get rid of ever repeating npm run prefix.
I do this because each package targets a specific minimum node version. When ever I am forced or willing to upgrade node I must not care for globally installed packages unless installed globally, of cause. Some few CLI tools require other global CLI tools. Only in his case I am forced to install a package gloabaly. To not forget about such global package I add an echo script to my package.json which yells about this global package and I add this echo to all scripts 'yell && <script name>`. Now I can't forget to frequently search for non global alternatives.
Additionally when installing a package locally I can reference it in import or require statements fairly easily. No construct required to check if the global package exists and matches the expected version or a version range. I see it often that in tutorials authors recommend installing gulp and webpack globally but then require either one or both packages in a local script. This can pay back badly when you upgrade node or npm or any plugin you were told to install.
PS: @sandeep I hacked this message on mobile :-)
Currently I've added "node_modules/.bin" to my $PATH, so I can run binaries when I'm in the project's directory. Are there any downsides with this approach, compared to scripts?