When should I use npm with “-g” flag and why?

-g is the global install flag, as explained in this answer. It’s covered in detail in this node blog post.

The rules of thumb:

  • Install globally if the package provides command-line tools
  • Install locally if you’re using the package as part of your application
  • Install globally and locally if both use-cases apply

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)