Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node package priority, global vs local

I've noticed that I have Angular 2 installed globally, and I don't know when I might have done that, or if that's the way it's supposed to be. It doesn't seem like that would be necessary if it's defined in every project.

It makes me wonder what side effects that have if I had different versions locally and globally. Which one takes priority? What's the best way to remove all of the Angular packages.

like image 713
BBaysinger Avatar asked Mar 22 '26 04:03

BBaysinger


1 Answers

Globally installed NPM packages really only impact your command-line environment. Things like pm2 or sequelize insert bin/ stubs into the PATH to make your life easier.

In order to require something it needs to be present in package.json as well as properly installed.

like image 175
tadman Avatar answered Mar 23 '26 18:03

tadman