Fixing npm permissions

You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to write to the directories that npm uses to store global packages and commands.

You can fix this problem using one of three options:

  1. Change the permission to npm’s default directory.
  2. Change npm’s default directory to another directory.
  3. Install node with a package manager that takes care of this for you.